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

exclude nModified from legacy write results

    XMLWordPrintableJSON

Details

    • Fully Compatible
    • ALL
    • Hide

      With the 2.6 shell connected to a 2.4 server:

      repl0:PRIMARY> db.serverBuildInfo().version
      2.4.9
      repl0:PRIMARY> db.coll.drop()
      true
      repl0:PRIMARY> db.coll.insert([{_id: 1}])
      Cannot use commands write mode, degrading to compatability mode
      WriteResult({ "nInserted" : 1 })
      repl0:PRIMARY> var bulk = db.coll.initializeOrderedBulkOp()
      repl0:PRIMARY> bulk.find({_id: 1}).update({$set: {x: 1}})
      repl0:PRIMARY> bulk.execute()
      BulkWriteResult({
          "writeErrors" : [ ],
          "writeConcernErrors" : [ ],
          "nInserted" : 0,
          "nUpserted" : 0,
          "nMatched" : 1,
          "nModified" : 0,
          "nRemoved" : 0,
          "upserted" : [ ]
      })

      Show
      With the 2.6 shell connected to a 2.4 server: repl0:PRIMARY> db.serverBuildInfo().version 2.4.9 repl0:PRIMARY> db.coll.drop() true repl0:PRIMARY> db.coll.insert([{_id: 1}]) Cannot use commands write mode, degrading to compatability mode WriteResult({ "nInserted" : 1 }) repl0:PRIMARY> var bulk = db.coll.initializeOrderedBulkOp() repl0:PRIMARY> bulk.find({_id: 1}).update({$set: {x: 1}}) repl0:PRIMARY> bulk.execute() BulkWriteResult({ "writeErrors" : [ ], "writeConcernErrors" : [ ], "nInserted" : 0, "nUpserted" : 0, "nMatched" : 1, "nModified" : 0, "nRemoved" : 0, "upserted" : [ ] })

    Description

      If nModified cannot be returned, like with a legacy write using GLE, then it should be excluded to indicate it is not valid. This is true in both the shell, and server (including mongos).

      Attachments

        Activity

          People

            scotthernandez Scott Hernandez (Inactive)
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: