-
Type: Bug
-
Resolution: Done
-
Priority: 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
-
Empty show more show less
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.