使用mongo命令进入数据后再进行权限认证
mongo
...
use admin
...
db.auth('username','password')
查询集合的所有文档记录
>db.collection.find().pretty()
#pretty()是以格式化的形式输出
查询特定条件的文档
>db.collection.find({'age':{'$gt':20})
删除集合里的所有文档记录
>db.collection.remove({})
使用mongo命令进入数据后再进行权限认证
mongo
...
use admin
...
db.auth('username','password')
查询集合的所有文档记录
>db.collection.find().pretty()
#pretty()是以格式化的形式输出
查询特定条件的文档
>db.collection.find({'age':{'$gt':20})
删除集合里的所有文档记录
>db.collection.remove({})