I want to store bulk data (more than 1000 or 10000 records) in a single operation by MongoOSE. But MongoOSE does not support bulk operations so I will use the native driver (MongoDB, for insertion). I know that I will bypass all MongoOSE middlewares but its ok. (Please correct me If I am wrong! :) )
I have an option to store data by insert
method. But MongoDB also provides Bulk class (ordered and unordered operations). Now I have the following questions:
- Difference between
insert
andbulk
operation (both can store bulk data) ? - Any specific difference between
initializeUnorderedBulkOp()
(performs operation in serially) andinitializeOrderedBulkOp()
(performs operations in parallel) ? If I will useinitializeUnorderedBulkOp
then it will effect on by range search or any side-effects ?- Can I do it by Promisification (by BlueBird) ?? (I am trying to do it.)
Thanks
EDIT: I am talking about bulk
vs insert
regarding to multiple insertions. Which one is better? Insertion one by one by bulk builder OR insertion by batches (1000) in insert method. I hope now it will clear Mongoose (mongodb) batch insert? this link