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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.9.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      mongodb 1.8.2
    • Operating System:
      Windows

      Description

      >
      > 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}

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: