当前位置:网站首页>MongoDB数据库入门的常用命令
MongoDB数据库入门的常用命令
2022-07-03 13:42:00 【稻田里展望者】
选择切换数据库:use articledb
插入数据:db.comment.insert({bson数据})
查询所有数据:db.comment.find();
条件查询数据:db.comment.find({条件})
查询符合条件的第一条记录:db.comment.findOne({条件})
查询符合条件的前几条记录:db.comment.find({条件}).limit(条数)
查询符合条件的跳过的记录:db.comment.find({条件}).skip(条数)
修改数据:db.comment.update({条件},{修改后的数据})db.comment.update({条件},{$set:{要修改部分的字段:数据})
修改数据并自增某字段值:db.comment.update({条件},{$inc:{自增的字段:步进值}})
删除数据:db.comment.remove({条件})
统计查询:db.comment.count({条件})
模糊查询:db.comment.find({字段名:/正则表达式/})
条件比较运算:db.comment.find({字段名:{$gt:值}})
包含查询:db.comment.find({字段名:{$in:[值1,值2]}})db.comment.find({字段名:{$nin:[值1,值2]}})
条件连接查询:db.comment.find({$and:[{条件1},{条件2}]})db.comment.find({$or:[{条件1},{条件2}]})
边栏推荐
- Metal organic framework material zif-8 containing curcumin( [email protected] Nanoparticles) | nano metal organic framework carry
- Too many files with unapproved license
- Reflection -- basic usage
- How to bold text in AI
- JVM runtime data area
- JVM class loading
- Exercise 10-3 recursive implementation of exponential functions
- Exercise 10-1 judge the three digits that meet the conditions
- Example analysis of QT learning 18 login dialog box
- QT learning 24 layout manager (III)
猜你喜欢

Exercise 10-2 recursive factorial sum

【吉林大学】考研初试复试资料分享

jvm-对象生命周期

Exercise 6-1 classify and count the number of characters

Qt学习19 Qt 中的标准对话框(上)
[email protected]纳米粒子"/>金属有机骨架MIL-88负载阿霉素DOX|叶酸修饰UiO-66-NH2负载阿霉素[email protected]纳米粒子

JVM runtime data area

Qt学习21 Qt 中的标准对话框(下)

Redis: operation command of string type data

Why are grass-roots colleges and universities with "soil and poverty" called "Northeast small Tsinghua"?
随机推荐
Leetcode(4)——尋找兩個正序數組的中比特數
JS get DPI, PX to cm, cm to PX
JS download files through URL links
Exercise 8-7 string sorting
Uniapp skills - scrolling components -1
Collection of mobile adaptation related articles
Simulated access
Exercise 6-1 classify and count the number of characters
Selenium browser (1)
JVM family - overview, program counter day1-1
玖逸云黑免费无加密版本源码
selenium 浏览器(1)
交联环糊精金属有机骨架负载甲氨蝶呤缓释微粒|金属-有机多孔材料UiO-66负载黄酮苷类药物|齐岳
Toast UI editor (editor allows you to edit your markup document using text or WYSIWYG, with syntax highlighting, scrolling synchronization, real-time preview and chart functions.)
Exercise 10-3 recursive implementation of exponential functions
Fabric. JS document
Function calling convention
jvm-类加载
Common mixins
MySQL data processing value addition, deletion and modification