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

Illegal key names allowed in $set command

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.1.0
    • Affects Version/s: 1.8.2, 2.0.0-rc0
    • Component/s: Write Ops
    • None
    • ALL

      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

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

              Created:
              Updated:
              Resolved: