Meteor: Error: Not permitted. Untrusted code may only remove documents by ID

You’re also not allowed to call remove({}) from any client side code. If your app accumulates a bunch of crufty data while you’re prototyping, you might be sad about this. Client side code and the console fall under the concept “Untrusted Code” introduced by Meteor in 0.5.8.

“Trusted Code” includes the server code and method code. The key to the solution is that you can call methods defined on the Meteor server from the client using the Meteor.callmethod. Therefore, this will work in the console

Assuming you define removeAllPosts on the server like so