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

Full document replacement can change type of _id

    XMLWordPrintable

Details

    • ALL
    • v3.6
    • Hide

      > db.c.insert({_id: 1})
      WriteResult({ "nInserted" : 1 })
      > db.c.update({_id: 1}, {_id: NumberDecimal(1)})
      WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
      > db.c.find()
      { "_id" : NumberDecimal("1.00000000000000") }
      

      Show
      > db.c.insert({_id: 1}) WriteResult({ "nInserted" : 1 }) > db.c.update({_id: 1}, {_id: NumberDecimal(1)}) WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 }) > db.c.find() { "_id" : NumberDecimal("1.00000000000000") }
    • Query 2018-02-12

    Description

      Full document replacement can change the type of immutable fields in 3.6. It cannot change the value. Modifier-style updates cannot change the type.

      Attachments

        Issue Links

          Activity

            People

              backlog-query-optimization Backlog - Query Optimization
              benety.goh@mongodb.com Benety Goh
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated: