MongoDB database operations

 

1, show dbs // show all databases

There are four default MongoDB database:

  • Information stored in the database administrator admin
  • config store configuration information
  • local
  • test test database is used by default

 

2, db // display the database currently in use

 

3, use dbname // switch to the specified database. If the database does not exist, it will first be created automatically. This command also create MongoDB database.

 

4, db.dropDatabase () // delete the current database. db. indicates the operation of the current database.

 

Guess you like

Origin www.cnblogs.com/chy18883701161/p/11100596.html