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

Illegal key names allowed in $set command

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.8.2, 2.0.0-rc0
    • Fix Version/s: 2.1.0
    • Component/s: Write Ops
    • Labels:
      None
    • Operating System:
      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

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: