Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-2926

Running BulkOp.execute twice does not error

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.0.0
    • Affects Version/s: 4.0.0
    • Component/s: Shell
    • None

      Per the drivers spec: https://github.com/mongodb/specifications/blob/master/source/driver-bulk-update.rst#on-bulk-execution

      "A descriptive error should be raised if execute is called more than once."

       

      To recreate:

      > const bulk = await db('test').collection('coll').initializeOrderedBulkOp()
      > bulk.insert({})
      > await bulk.execute()
      --> returns result object
      > await bulk.execute()
      --> returns the same bulk object instead of throwing an error. It does not appear like the ops are executed twice

      In 3.6.3 an error is thrown.

            Assignee:
            matt.broadstone@mongodb.com Matt Broadstone
            Reporter:
            anna.herlihy@mongodb.com Anna Herlihy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: