How do you delete user accounts in Meteor?

You could do

meteor mongo

or

meteor mongo myapp.meteor.com for a deployed app

Then

db.users.remove({_id:<user id>});

I wouldn't recommend it but if you want to delete any user without being logged in from meteor you would need to modify the allow rules. But deleting a user is a very unlikely event hence the above might be the best way to do it.

Anyway if you do want, modify the Meteor.users.allow({remove:function() { return true }); property. See http://docs.meteor.com/#allow. You could add in some custom logic there so it'll only let you do so if you're the admin


I was having trouble doing this on nitrous.io because I couldn't open both Meteor and Mongo. I put:

Meteor.users.remove(' the _id of the user ');

in the isServer section to remove the user.

Tags:

Meteor