PHP is used to connect to the mongodb database. I use PHP to connect to the mango database, and I can also create a database, that is, I cannot insert data. The operations of the mango database on the SHELL client are normal. The following is the test code.
"MongoDB", "type" => "database", "count" => 1, "info" => (object) array ("x" => 203, "y" => 102), "versions" => array ("0.9.7", "0.9.8", "0.9.9"); $ connection = new clients client (); $ collection = $ connection-> mydb-> tbname; $ collection-> insert ($ doc);?>
This is found in the database after running. mydb has been created successfully, but the data is empty.
It has been bothering me for a few days. I don't know what went wrong. please help me.
If it is unclear, add QQ 11-50-96-770.
Reply to discussion (solution)
Db. mydb. find () is incorrect.
Db. <Set name> . Find () you have written the library name.
Use show collections to view the set
Then execute this db statement. you can view the set. find ()
Thank you.
I 've been suffering for a few days. it turns out that my database data is not complete. Big God, you add me QQ. I must send you a red envelope.