How do you ensure an update has finished in meteor before running a find?
问题 I have a fairly typical need, to ensure an insert / update has finished before I run a find. The code goes something like this: //Update my collections Messages.insert({author:_id,text:text}); Authors.update({_id:_id},{$inc:{messages:1}}); //Wait until the update / insert has finished //Perform some actions on the collections just updated var author = Authors.findOne({task:taskId},{sort:{'messages':1}}); //Do some more complex stuff... While in most cases this would be fine as asynchronous