Reputation: 1040
I looked for findAndModify semantics in PHP but couldn't find any, would be happy to get reference / examples for this functionality.
Upvotes: 3
Views: 2169
Reputation: 1632
For those still looking for this--This has now been implemented. http://php.net/manual/en/mongocollection.findandmodify.php
Upvotes: 1
Reputation: 12439
Here's the JIRA issue for the fact that it's missing from the PHP driver, which includes a workaround:
It's a database command, you can do:
$db->command(array("findandmodify" => "collectionName", "query" => ...));
See http://www.mongodb.org/display/DOCS/findandmodify+Command for details.
Upvotes: 4