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

Increment opcounters for bulk insert

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.3, 2.1.0
    • Affects Version/s: 2.0.0
    • Component/s: Querying
    • None
    • ALL

      Currently we only increment opcounters for bulk insert if one of the inserts fails

      In [8]: db.command('serverStatus')['opcounters']['insert']
      Out[8]: 0

      In [9]: db.foo.insert([{}])
      Out[9]: [ObjectId('4e6e698f7b98300f2b000003')]

      In [10]: db.command('serverStatus')['opcounters']['insert']
      Out[10]: 1

      In [11]: db.foo.insert([{},{}])
      Out[11]: [ObjectId('4e6e699f7b98300f2b000004'), ObjectId('4e6e699f7b98300f2b000005')]

      In [12]: db.command('serverStatus')['opcounters']['insert']
      Out[12]: 1

      In [14]: db.foo.insert([

      {'_id':1}

      ,

      {'_id':1}

      ,

      {'_id':1}

      ])
      Out[14]: [1, 1, 1]

      In [15]: db.command('serverStatus')['opcounters']['insert']
      Out[15]: 2

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: