韩漫免费漫画在线观看方法,《好好疼爱里面》免费看,年轻漂亮的女士护士内衣,妈妈醉酒后把我当爸爸电视剧

文章 > MongoDB > mongodb查询语句有哪些

mongodb查询语句有哪些

头像

silencement

2020-01-08 14:16:133637浏览 · 0收藏 · 0评论

如果觉得 Mongodb 语句不太好理解,可以和 SQL 语句进行对比,学起来要容易很多。

查询(find)

查询所有结果

select * from article
db.article.find()

指定返回哪些键

select title, author from article
db.article.find({}, {"title": 1, "author": 1})

where条件

select * from article where title = "mongodb"
db.article.find({"title": "mongodb"})

and条件

select * from article where title = "mongodb" and author = "god"
db.article.find({"title": "mongodb", "author": "god"})

or条件

select * from article where title = "mongodb" or author = "god"
db.article.find({"$or": [{"title": "mongodb"}, {"author": "god"}]})

比较条件

select * from article where read >= 100;
db.article.find({"read": {"$gt": 100}})
> $gt(>)、$gte(>=)、$lt(<)、$lte(<=)
 select * from article where read >= 100 and read <= 200
 db.article.find({"read": {"$gte": 100, "lte": 200}})

in条件

select * from article where author in ("a", "b", "c")
db.article.find({"author": {"$in": ["a", "b", "c"]}})

like

select * from article where title like "%mongodb%"
db.article.find({"title": /mongodb/})

count

select count(*) from article
db.article.count()

不等于

select * from article where author != "a"
db.article.find({ "author": { "$ne": "a" }})
关注

关注公众号,随时随地在线学习

本教程部分素材来源于网络,版权问题联系站长!

动物扌桑辶鬲的| 父女一起到达巅峰的小说| 日本儿子娶母亲的电视剧| 父亲开了两个女儿包演员表| 50多岁熟妇泻火原因处理方法| 丫头把腿开大让我添添电影| 男人添女人荫道口视频| 《交换做爰》在线观看| 环球小姐大赛| 倒插莲花男女之间的寓意| 恶魔之地| CSGO暴躁妹妹免费观看电视剧| 妻子的肉体偿还》5| AAA成人片爽久爽久爽| 男同网站| 性高朝久久久久久久久久| 星空传媒天美传媒有限公司 | 老赵抱着陈婷在厨房做饭视频 | 美国伦理小樱桃1| 法国《监狱伦理3》| 第1章饱满的乳峰喷奶水动漫| 比白洁还牛的四大书| BOBO浏览器(海外版| 打扑牌不盖被子怎么办| 谷原希美| 女性一晚上3次纵欲导致不孕 | 九1黄9·1| 《黑人性奴2》免费观看| 轮流和两个男人一起很容易染病吗 | 法国空姐| A片| 鲁鲁射击免费播放电视剧全部| 《玉蒲团2之艳乳欲仙欲》| 扒开腿让我躁你很舒服的导演是谁 | 三男一女CP免费观看电视剧大全| 录像狗配女人| B站入口直接进入| 麻花星空天美MV免费观看电视剧 | 鲁鲁射击免费播放电视剧全部| 女性真人外生图片大全| 《军舰上的女兵》法国版完整版