I\'ve tried
db.users.remove(*)
Although it returns an error so how do I go about clearing all records?
To remove all the documents in all the collections:
db.getCollectionNames().forEach( function(collection_name) {
if (collection_name.indexOf("system.") == -1) {
print ( ["Removing: ", db[collection_name].count({}), " documents from ", collection_name].join('') );
db[collection_name].remove({});
}
});