-
Type: Bug
-
Resolution: Cannot Reproduce
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.2.34, 3.0.4
-
Component/s: Native
-
Labels:
-
Environment:MongoDB 3.2+, node-mongodb-native 2.2+
-
Empty show more show less
I noticed this with the node-mongodb-native driver at v2.2, when we started using schema validations.
Any violation of a schema validator will cause MongoDB to not accept the insert/update, but the driver will return result:
{ ok: 1 }anyway. If the op is an insert, it'll also return the "inserted" doc, and add an .insertedId ObjectId property, which of course matches nothing in the database since the insert op failed.
I thought it might be because 2.2 of the driver predated the schema validation feature, but having just upgraded to v3.0, I can confirm that the issue remains.
It seems to me like a bug, but maybe I need to be schooled a bit?
Cheers,
Daniel