一、登录
登录命令:mongo localhost/db -u username -p。其中db为要登录的db,username为账户,然后输入密码回车:

登录成功
二、数据库操作
1、创建db:use testDB。
2、查看有哪些db:show dbs。
3、查看当前db:db
4、查询集合

5、退出
登录命令:mongo localhost/db -u username -p。其中db为要登录的db,username为账户,然后输入密码回车:
登录成功
1、创建db:use testDB。
2、查看有哪些db:show dbs。
3、查看当前db:db
4、查询集合
5、退出