2015-10-16 46 views

回答

1

git repo将能够跟踪您的模式设计中的更改,但不会收集您的集合中的实际数据。

要跟踪集合中的更改,您需要启动另一个数据库。如果您花时间输入/收集大量数据,我建议您做一些类似mongoexport的事情。

我敢肯定,你以前见过的模式,但数据可能会再在服务器上启动函数加载:

Meteor.startup(function() { 
    if (Collection.find().count() === 0) { 
    console.log("Importing private/collection.json to db") 

    //grabs data from exported json file 
    var data = JSON.parse(Assets.getText("collection.json")); 

    //adds it to your collections 
    data.forEach(function (item, index, array) { 
     Collection.insert(item); 
    }) 
    } 
}); 
相关问题