Reputation: 265
I would like to clean all the files from the GridFS of a particular Mongo database. The mongofiles command line utility has a delete function but I don't know how to tell it do delete "all files". I've been using MongoVue to select and delete the files in the fs view of GridFS but that only lets you delete specific number of selected files.
What I'm looking for is the SQL equivalent of Delete * FROM
Upvotes: 0
Views: 1286
Reputation: 167
db.fs.files.remove({})
db.fs.chunks.remove({})
db.repairDatabase() (cleans out the memory)
running these commands should remove all files
Upvotes: 4