Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // http://leaderboard2.meteor.com/
- //
- // client-side js to clear the Players database from mongodb
- //
- // simple remove-all operation not permitted by untrusted client, i.e. Players.remove({});
- // fetch all the records. inefficient but works for small databases. better to iterate using cursor.
- var players = Players.find({}).fetch();
- for (p in players) {
- // remove by _id is permitted
- Players.remove({_id: players[p]._id});
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement