Under mongo DB Linux common operations command


Sudo MongoDB Start Service to start mongo
mongo mongo enter the command

show dbs to see that there's a list of database
db view the current set of database objects or
use the database name to create the database
db.dropDatabase () destroy the database:
create a collection mydb database in
use mydb
Switched to db mydb
db.createCollection ( "the Users")

View create collections
show collections

Delete Collection
Show the Collections
db.users.drop ()

Check whether to delete the successful
show collections

Guess you like

Origin www.cnblogs.com/pp8080/p/12056829.html