![](/img/trans.png)
[英]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.