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

initializeUnorderedBulkOp should not reject Promise on writeErrors

    XMLWordPrintable

    Details

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

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: