How can I update or insert bulk operations in Meteor Mongodb?
Here is my simple script:
var obj = [];
for(var i = 0; i < 100000; i++){
obj.push({title: i, inTime: new Date(), outTime: new Date})
}
Activities.bulkWrite([
{
insertMany: obj
}
])
Why I am getting this error:
Exception while invoking method TypeError: Activities.bulkWrite is not a function
it works in default meteor. with oplog, subscribers will be notified immediatly. Without oplog, the server polls the db every 5 seconds for changes on that, which also works.
Be careful that this does NOT work with redis-oplog. I do not recommend to use redis-oplog in general, because it has many pitfalls like this (only use it if you know exactly how it needs to be used)