-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 3.1.10
-
Component/s: Docs
After reading the documentation at http://mongodb.github.io/node-mongodb-native/3.1/api/Collection.html#initializeOrderedBulkOp, I wanted to call some updateOne methods on the bulk object returned by initializeUnorderedBulkOp:
const bulk = collection.initializeUnorderedBulkOp();
{{bulk.updateOne({ _id: foo }, { $set:
});}}
However, this resulted in TypeError: bulk.updateOne is not a function.
I found out from StackOverflow that I need to prefix each operation with "find" (why?).
The documentation should mention all available methods on the bulk operation types, not just execute:
http://mongodb.github.io/node-mongodb-native/3.1/api/OrderedBulkOperation.html
http://mongodb.github.io/node-mongodb-native/3.1/api/UnorderedBulkOperation.html