Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete temporary MapReduce collections in mongoDB

Is there anyway I can delete all the temporary map reduce collections? I read you can pass a parameter boolean, to either keep or delete the collections. ut the parameter is for the shell, and I use the java drivers. Therefore, I cant set the collection to delete upon completion of the query. Is there any shell command to delete all?

db.collections.help()

does not list any command related with that.

Show below is a sample of the collections I have.

tmp.mr.mapreduce_1289483912_1
tmp.mr.mapreduce_1289483918_2
tmp.mr.mapreduce_1289483919_3
tmp.mr.mapreduce_1289483974_4
tmp.mr.mapreduce_1289483977_5
tmp.mr.mapreduce_1289484057_6
tmp.mr.mapreduce_1289484058_7
tmp.mr.mapreduce_1289484147_8
tmp.mr.mapreduce_1289484148_9
tmp.mr.mapreduce_1289541146_10
tmp.mr.mapreduce_1289541150_11
tmp.mr.mapreduce_1289542389_12
tmp.mr.mapreduce_1289542390_13
tmp.mr.mapreduce_1289543164_14
tmp.mr.mapreduce_1289543165_15
like image 827
theTuxRacer Avatar asked Nov 12 '10 08:11

theTuxRacer


1 Answers

They should be deleted when the connection to the database is closed. See the answers to this question for details and a way to delete them manually.

like image 186
Niels van der Rest Avatar answered Oct 05 '22 03:10

Niels van der Rest