readthefuckingmanual.net

[SOLVED] uncaught exception: findAndModifyFailed failed: "no such cmd: _id"

Error added: 2012-10-10T19:08:07Z

0 people waiting for the answer...

2 answers found.

Answer 2050 (0.0% helpful)

You need to use the (new?) syntax, like in this example:

db.people.findAndModify( {
    query: { name: "Tom", state: "active", rating: { $gt: 10 } },
    sort: { rating: 1 },
    update: { $inc: { score: 1 } }
    } );
Permalink

Answer 2529 (0.0% helpful)

db.collection.findAndModify() will only select one document to modify.
Permalink

Add an answer/solution

If you know the answer, please add your own solution below.
If you don't know, but find out later, please come back and share your answer - there will be other people struggling with this too.


Please enter 61948 here

If you want to be notified via email when this is solved, enter your email address here: