我从Meteor.methods()中调用函数获取一组文档。现在我想在本地集合中发布这些文档,这些集合应该只是客户端。我怎么能这样做?
Meteor.methods({
fillCollection: function (userId) {
var record = Meteor.call('checkedOutRecordIds', userId);
var results = Meteor.call('getCheckedOutDocuments', userId, record);
// I want to store these results in a local collection.
// I have tried it, but it doesn't let me.
results.forEach(function (doc) {
localCollection.insert(doc);
});
}});
由于