There are a lot of mongodb collections in my database that I need to delete. They all have similar names, and it would be easy to delete them if only wildcard characters cou
For regex you can use string.match
db.getCollectionNames().forEach(function(c) { if(!c.match("^system.indexes")) { db.getCollection(c).drop(); } });