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

initializeUnorderedBulkOp should not reject Promise on writeErrors

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.2.30
    • Component/s: MongoDB 3.2, MongoDB 3.4
    • Environment:
      MacOS 10.12.6, Node.js 6.11.1
    • 1

      When doing a initializeUnorderedBulkOp, and (at least) one write operation fails, if I pass a callback (err, result), I get both the error and the result, where the error is pretty much useless, but in the result I can get the WriteErrors explaining what failed.

      But when I don't pass a callback and get a promise back, the promise gets rejected, and all I get is a useless error in the .catch, but I have no way of getting the full WriteErrors.

      I believe the Promise returned should be rejected only when the whole operation fails (eg. connection error) but if one of the many operations in the bulk fails, it should still resolve the promise, and the developer should manage exceptions.

            Assignee:
            matt.broadstone@mongodb.com Matt Broadstone
            Reporter:
            kikar Gady Piazza
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: