2016-02-09 83 views
0

下从蒙戈集合所有文件浏览器控制台显示的收集有记录,但是当我尝试Tasks.remove({});在浏览器控制台我得到一些错误:删除流星

errorClass {error: 403, reason: "Not permitted. Untrusted code may only remove documents by ID.", details: undefined, message: "Not permitted. Untrusted code may only remove documents by ID. [403]", errorType: "Meteor.Error"}

不知道如何删除所有文件从收集包括_id(s)?由于

Meteor.subscribe('tasks'); 
 

 
Meteor.publish('tasks', function(){ 
 
    return Tasks.find(); 
 
});

回答

0

您可以同时在服务器上只删除多个文档作为documented on the Meteor site

因此,要清除集合,您需要在服务器代码中执行此操作,并在需要从客户端调用此方法时创建一个方法。