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

when i update a object, if a key not in object it should insert a new key, but i fact my existsing key are replaced by key

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.9.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      mongodb 1.8.2
    • Windows

      >
      > db.test.foo.remove()
      > db.test.foo.insert({"a":

      {"c00":1}

      , 'c':2})
      > db.test.foo.update(

      {"c":2}

      , {'$inc':{'a.c000':1}})

      > db.test.foo.find(

      {"c":2}

      )
      { "_id" : ObjectId("4def5621c3ac2d33b5f4d812"), "a" :

      { "c000" : 2 }

      , "c" : 2 }
      >

      why not {"a":

      {'c000":1, 'c00':1}

      , 'c':2}

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            gsk327@163.com gsk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: