-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.4
-
Component/s: None
-
Environment:Linux 64-bit Ubuntu
-
Empty show more show less
I am using MongoDB 2.4.9 and version 1.3.23 of the node driver.
The find() method modifies its options argument. This simple object:
{ hint:
{ path: 1 }}
Becomes (for example - it varies with the query):
{"skip":0,"limit":0,"raw":false,"hint":null,"slaveOk":false,"read":"primary","selector":{"$and":[{"$and":[{"$and":[{"$and":[{},{"_id":{"$in":["968479889252014764","414733286351587838"]}}]},{}]},
{"type":"event"}]},{"trash":{"$ne":true}},{"$or":[{"published":true,"loginRequired":{"$exists":false}}]}]},"readPreference":"primary","sort":{"explicitDates.end":1}}
In this case "hint" became null because I didn't have an index, which makes sense and is not what this ticket is about. My concern is that the object is modified and this behavior is undocumented, so users who expect to turn around and pass that same object for another query may get unexpected results.