I have number of collection in my mongodb.
The collections names are like aaa_123,aaa_345,aaa_ccc,mmm,nnn and etc...
Many collections name has prefixed with aaa_ and also other collection name also present, I need to delete only the collection names prefixed with aaa_ , but in manual I deleted like db.aaa_123.drop(), its take long time to delete collection , Is there anyway to delete all collections with prefixed aaa_ in mongodb?
Anyhelp appreciated..
db.getCollectionInfos({ "name": /^aaa/ }).forEach( i => db.getCollection(i.name).drop() )