So for some heavy lifting server methods, which insert & update thousands of mongo items, I am using
const myQueue = myMeteorMongoCollection.rawCollection().initializeUnorderedBulkOp();
Then, I am using the bulk operations to “add” operations to my queue - and execute() it:
Which is very weird is, that all the helpers functions, like .
.toString() and (after executing the queue)
.getOperations() … these all do not work!
As soon as I call e.g.
Meteor.setInterval(() => console.log('getOperations', myQueue.getOperations()), 500);
I end up with:
myQueue.getOperations is not a function
I don’t get it … what am I doing wrong?
I need to
await my queue finishing, only afterwards I can call my seconds queue - how do I do that?
I tried a simple
await, I also tried calling
Meteor.wrapAsync(myQueue.execute, myQueue)(), but both do not really wait for the finish.