Show all available databases:
show dbs;
Select a particular database to access, e.g. mydb
. This will create mydb
if it does not already exist:
use mydb;
Show all collections in the database (be sure to select one first, see above):
show collections;
Show all functions that can be used with the database:
db.mydb.help();
To check your currently selected database, use the command db
> db
mydb
db.dropDatabase()
command is used to drop a existing database.
db.dropDatabase()