如何发布通过Meteor.method()调用获取的记录

时间:2015-01-26 11:33:15

标签: meteor

我从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);
        });
    }});

由于

0 个答案:

没有答案