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

Increment opcounters for bulk insert

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.0.0
    • 2.0.3, 2.1.0
    • Querying
    • None
    • ALL

    Description

      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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: