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

Updates allow creating $id/ref/db prefixed fields

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.5.3
    • 2.5.4
    • 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

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: