Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Simple script to clean out any collections which are temporal
- var collections = db.getCollectionNames();
- for(var i in collections) {
- if (collections[i].match(/(^log_|_temp_)/)) {
- if (db[collections[i]].drop()) {
- collections[i] = collections[i].replace(/\s$/, '');
- print('Dropped ' + collections[i]);
- } else {
- collections[i] = collections[i].replace(/\s$/, '');
- print('db.' + collections[i] + '.drop();');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement