I'm following a book example about Meteor and I'm trying to remove an item, like this:
lists.remove({Category:"Fraggles"})
However, this doesn't work anymore in the last version of Meteor and I get the following console error: 403 reason: "Not permitted. Untrusted code may only remove documents by ID."
I found the id like this:
lists.findOne({Category:"Fraggles"})
Object {_id: "T88C6tx4G9YJpLzn5", Category: "Fraggles"}
But I do not know how to use the correct syntax to actually remove it. Any help would be appreciated.
Thank you!
I'm following a book example about Meteor and I'm trying to remove an item, like this:
lists.remove({Category:"Fraggles"})
However, this doesn't work anymore in the last version of Meteor and I get the following console error: 403 reason: "Not permitted. Untrusted code may only remove documents by ID."
I found the id like this:
lists.findOne({Category:"Fraggles"})
Object {_id: "T88C6tx4G9YJpLzn5", Category: "Fraggles"}
But I do not know how to use the correct syntax to actually remove it. Any help would be appreciated.
Thank you!
Share Improve this question edited Apr 2, 2013 at 12:15 Joseph at SwiftOtter 4,3215 gold badges38 silver badges56 bronze badges asked Apr 2, 2013 at 11:58 Valentin G.Valentin G. 1752 gold badges2 silver badges8 bronze badges1 Answer
Reset to default 14lists.remove('T88C6tx4G9YJpLzn5') will remove the document with the _id: T88C6tx4G9YJpLzn5.
http://docs.meteor./#remove
If you want to remove more than one document you can define a method which runs on the server and call from the client.
http://docs.meteor./#meteor_methods