[SERVER-11241] Updates allow creating $id/ref/db prefixed fields Created: 17/Oct/13  Updated: 11/Jul/16  Resolved: 22/Oct/13

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: 2.5.3
Fix Version/s: 2.5.4

Type: Bug Priority: Major - P3
Reporter: Amalia Hawkins Assignee: Scott Hernandez (Inactive)
Resolution: Done Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-14244 Additional tests for setting fields w... Closed
Operating System: ALL
Participants:

 Description   

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.



 Comments   
Comment by auto [ 22/Oct/13 ]

Author:

{u'username': u'scotthernandez', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}

Message: SERVER-11241: remove unrelated stuff from prev commit
Branch: master
https://github.com/mongodb/mongo/commit/8a392fee1f44fab3c9b8158d1dc74de6521804a6

Comment by auto [ 22/Oct/13 ]

Author:

{u'username': u'scotthernandez', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}

Message: SERVER-11241: Updates allow creating $id/$ref/$db prefixed fields
Branch: master
https://github.com/mongodb/mongo/commit/296ddd1ce096cb91a863d9438ff3aabd4b1d0a78

Generated at Thu Feb 08 03:25:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.