Okay I overcame this issue by using the async module specifically async.queue.
I was able to create this variable:
var q = async.queue(function(task, cb){
cb();
}, 50)
q.drain = function() {
console.log('all items have been processed');
}
From my stream:
q.push({name:dbUpdate}, function(err){
db.collection('my-db').update({id:data.id},{$set:{notes:data.notes}},{upsert:true},function(err,res){
//do something
})
})
I am positive now that my problem was more on node's mongodb-driver side.
Thanks everyone!