rs0:PRIMARY> use admin
switched to db admin
rs0:PRIMARY> db.auth("myUserAdmin", "abc123" )
1
show dbs;
use mydb
switched to db mydb
show collections
mycol
mycol2
system.indexes
runoob
删除集合 mycol2 :
db.mycol2.drop()
rs0:PRIMARY> use admin
switched to db admin
rs0:PRIMARY> db.auth("myUserAdmin", "abc123" )
1
show dbs;
use mydb
switched to db mydb
show collections
mycol
mycol2
system.indexes
runoob
db.mycol2.drop()