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

Illegal key names allowed in $set command

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 1.8.2, 2.0.0-rc0
    • 2.1.0
    • Write Ops
    • None
    • ALL

    Description

      See also SERVER-1991 and FREE-2519

      Problem:

      The following statement is allowed

      > db.test.insert(

      {"x":1}

      )
      > db.test.update(

      {"x":1}

      , {$set:{$set:1}})
      > db.test.find()

      { "$set" : 1, "_id" : ObjectId("4e5e10a88c7696dbcdd6a153"), "x" : 1 }

      Per the naming rules

      http://www.mongodb.org/display/DOCS/Legal+Key+Names

      ... a $ field name is illegal.

      Reproduce:
      See above

      Workaround:
      None

      Attachments

        Issue Links

          Activity

            People

              tonyh Tony Hannan
              alvin Alvin Richards (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: