Expected behavior is something along the lines of...
> db.foo.update({x:4},{$currentDate: {$x: true}}) $x contains field names with leading '$' character
However, the following is allowed and creates the $prefixed field.
> db.foo.update({x:4},{$currentDate: {$idfoo: true}}) > db.foo.find() { "_id" : ObjectId("525d7ae386ef72ddfdcdaf13"), "x" : 4, "$idfoo" : ISODate("2013-10-17T15:54:58.341Z") }
This logic (bug) is in field_checker.cpp in the isUpdatable function where it is allowing DBRef related fields.
- related to
-
SERVER-14244 Additional tests for setting fields with $ names
- Closed