Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-11241

Updates allow creating $id/ref/db prefixed fields

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.4
    • Affects Version/s: 2.5.3
    • Component/s: Write Ops
    • Labels:
    • ALL

      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.

            Assignee:
            scotthernandez Scott Hernandez (Inactive)
            Reporter:
            amalia.hawkins@10gen.com Amalia Hawkins
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: