christkv/node-mongodb-native — Issue #450: findAndModify hides mongo errors
Author: vincentcr
Created: 2011-12-16 23:03:33+00:00
State: open

this query should return an error from mongo because _id is not allowed in update:

```

var q = { x: 1 };
var set = { y:2, _id: new ObjectID() };
var opts = { new: true, upsert: true };

coll.findAndModify(q, [], obj, opts, function (err, res) {
assert.ok(err); // fails
assert.ok(! res); // ok
});

```

the equivalent in the mongo shell gives the error: "Mod on _id not allowed"

in previous versions of mongodb this is also what happened. now this results in both err, and res being null.