db.collection.find()
db.collection.find({属性:值})
db.collection.findOne()
查询集合中符合条件的所有的文档:
db.stus.find();//返回数组,里面有多个对象
db.stus.find({});
db.stus.find({_id:"hello"});
db.stus.find({age:28});
db.stus.find({age:28})[0];
db.stus.find({age:16,name:"白骨精"});
db.stus.findOne({age:28}).name;//返回一个对象
db.stus.find({}).count();
db.stus.find({}).length();
标签:stus,mongodb,age,db,collection,查询,命令,find,28 From: https://www.cnblogs.com/51testing/p/17117814.html