@elisha_langworth
To drop all databases in MongoDB, you will need to run the following command in the MongoDB shell:
1 2 |
use admin db.adminCommand( { "listDatabases": 1 } ).databases.forEach(function(d){db.getSiblingDB(d.name).dropDatabase()}) |
This command will switch to the admin database, list all databases, and then iterate through each database to drop them one by one. Make sure you have the necessary privileges to run this command as it will delete all data in all databases.