1,模糊查询
db.Person.find({"nickName":/n/})
{"foodname":{"$regex":",米饭"}}
2,非空查询
db.Person.find({"nickName":{"$not":{"$eq":null}}})
3,某一天的数据(并且审核通过)
db.Person.find({"createtime":{"$gte":ISODate("2019-03-20T16:00:00.000+0000"), "$lte":ISODate("2019-03-21T16:00:00.000+0000")}
,"status":"pass"}).count();
4,or
{"$or" : [{"name":"one"},{"name":"two"}]}
5,mongodb查询size大于1000的内嵌list的document

本文介绍了在Studio 3T中进行MongoDB数据库操作的一些实用命令,包括模糊查询、非空查询、特定日期且已审核的数据、OR条件查询以及如何优化查询size大于1000的内嵌list,提出通过创建额外字段并更新其长度来提升查询效率。
最低0.47元/天 解锁文章
22万+

被折叠的 条评论
为什么被折叠?



