How to get affected number of rows using mongodb ,php driver -


I have two problems: how can I get affected rows from php mongodb driver, and about the last entry id How in Thank you

You can get many results from the cursor using the count function:

  $ COLLECTION-> () Seems - & gt; Count ();   

You can also get the number of records in the collection by using:

  $ collection-> Count ();   

Using the inserted method, _id is automatically added to the input array.

  $ a = array ('x' => 1); $ COLLECTION- & gt; Insert ($ one, array ('safe' = & gt; true)); Var_dump (one $); Array (2) {["x"] = & gt; Int (1) ["_id"] = & gt; Object (MongoId) # 4 (0) {}}    

Comments