Check out example codes for "drop multiple database mongo". It will help you in understanding the concepts better.

Code Example 1

mongo --quiet --eval 'db.getMongo().getDBNames().forEach(function(i){db.getSiblingDB(i).dropDatabase()})'

Code Example 2

// if you have a list of Databases to delete then you may run the following command?


['db1', 'db2', 'db3', 'db4'].forEach(function(i){db.getSiblingDB(i).dropDatabase()})

Learn ReactJs, React Native from akashmittal.com