尝试更新匿名集合(客户端)上的所有条目时出现意外行为。只更新一个条目而不是全部。我希望以下代码返回 true,但事实并非如此:
TEST = new Meteor.Collection(null); // create the anonymous collection client side
TEST.insert({"val":true}); // add a minimal entry
TEST.insert({"val":true}); // add a second minimal entry
TEST.update({}, {"val":false}); // I expect to update all the entries to {"val":false}
TEST.find({"val":true}).count() === 0; // the count gives 1, only the first entry was updated (expected 0)
这要么是一个错误,要么是我没有得到的关于更新的东西……有人能澄清一下吗?注意:显然代码必须复制粘贴到运行 Meteor 的浏览器的控制台中。(在 0.8.0.1 上试过)