在我的應用程序中,用戶可以選擇刪除他所有的通知。作爲事件處理程序我有這樣的:刪除記錄userId不允許
Template.clearNotifications.events({
'click .clear-notifications': function() {
Notifications.remove({userId: Meteor.user()._id});
}
});
當它被調用時,我得到這個錯誤:
Uncaught Error: Not permitted. Untrusted code may only remove documents by ID. [403]
這是一個允許我忘了補充,或者是一般不允許這樣做?如果是這樣,我有什麼選擇刪除用戶的通知?
感謝戴夫,這正是我所期待的。我不知道從客戶端刪除只會刪除發佈的! – John