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

Updates allow creating $id/ref/db prefixed fields

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.5.4
    • 2.5.3
    • Write Ops
    • ALL

    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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: