2016-09-26 38 views

回答

0

您可以尝试在更新之前使用collection hooks停止observeChanges查询,然后在更新之后重新启用它。

let handle = MyCollection.find().observeChanges({...}); 

MyCollection.before.update(function() { handle.stop; }); 

MyCollection.after.update(function() { handle = MyCollection.find().observeChanges({...}); }); 

MyCollection.update({_id: 'xxx'}, {$set: {foo: 'bar'}}); 
+0

谢谢。我以不同的方式实施它,但很高兴知道 – foger