1.连接MongoDb
mongo --host xxxxxxx:3333 --authenticationDatabase admin -u root -p
xxxxxxx:3333为mongodb地址
展示有哪些数据库
show dbs
切换到xxx数据库
use xxx
展示当前数据库有哪些collections
show collections
查询news_collection 前两条数据
db.news_collection.find().limit(2)
查询 _id 为 ObjectId(“5a142878ad7d5814ed698b88”) 的数据
db.news_collection.find({"_id" : ObjectId("5a142878ad7d5814ed698b88")})