Skip to main content

Database Management

Select a database before reading collection information or performing administration.

use test;
db.getCollectionNames();
db.getCollectionInfos();
db.stats();
db.serverStatus();
db.version();

db.dropDatabase() deletes the current database and its collections. See Collections and Views for creation, and Database Commands for generic requests.