[英]How to undo “Meteor.publish”, and undo “new Meteor.Collection”
[英]How do you check if a Meteor.Collection is synchronized?
在我的应用程序中,我有一个对象,其字段是Meteor.Collections,其中一些尚未保存在服务器上。 例如:
var tables = {};
tables["existent"] = new Meteor.Collection("existent"); // existent on server
tables["nonexistent"] = new Meteor.Collection(null); // nonexistent on server
我需要检查集合是否还存在于服务器上。 除了在每个Collection上附加一些标志之外,还有其他方法可以检查吗?
我发现Collections有一个字段_name
,其中存储了传递给构造_name
的名称。 因此,如果您检查collection._name
,它应该返回传递给它的名称(如果它用一个初始化),否则返回null
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.