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

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 1.9.1
    • None
    • None
    • mongodb 1.8.2
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: