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!
lists.remove('T88C6tx4G9YJpLzn5') will remove the document with the _id: T88C6tx4G9YJpLzn5.
http://docs.meteor.com/#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.com/#meteor_methods
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With