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

"n" field in GLE following write command doesnt match command output

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • 2.6.0-rc0
    • Write Ops
    • ALL

    Description

      Insert seems to always report n=0. Update and delete seem to make it match the last op. This differs from how the upserted field is handled.

      > [db.foo.runCommand('update', {updates:[{q:{_id:1}, u:{an: 'object'}, upsert:true}, {q:{_id:2}, u:{an: 'object'}, upsert:true}]}), db.getLastErrorObj()]
      [
              {
                      "ok" : 1,
                      "nModified" : 0,
                      "n" : 2,
                      "upserted" : [
                              {
                                      "index" : 0,
                                      "_id" : 1
                              },
                              {
                                      "index" : 1,
                                      "_id" : 2
                              }
                      ]
              },
              {
                      "connectionId" : 2,
                      "updatedExisting" : false,
                      "upserted" : 2,
                      "n" : 1,
                      "syncMillis" : 0,
                      "writtenTo" : null,
                      "err" : null,
                      "ok" : 1
              }
      ]
      > [db.foo.runCommand('insert', {documents:[{},{}]}), db.getLastErrorObj()]
      [
              {
                      "ok" : 1,
                      "n" : 2
              },
              {
                      "connectionId" : 2,
                      "n" : 0,
                      "syncMillis" : 0,
                      "writtenTo" : null,
                      "err" : null,
                      "ok" : 1
              }
      ]
      > [db.foo.runCommand('delete', {deletes:[{q:{}, limit:1},{q:{}, limit:0}]}), db.getLastErrorObj()]
      [
              {
                      "ok" : 1,
                      "n" : 4
              },
              {
                      "connectionId" : 2,
                      "n" : 3,
                      "syncMillis" : 0,
                      "writtenTo" : null,
                      "err" : null,
                      "ok" : 1
              }
      ]
       

      Attachments

        Activity

          People

            greg_10gen Greg Studer
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: