当前位置:网站首页>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}]})
边栏推荐
- Dlopen() implements dynamic loading of third-party libraries
- 28:第三章:开发通行证服务:11:在配置文件中定义属性,然后在代码中去获取;
- js . Find the first palindrome string in the array
- 叶酸修饰的金属-有机骨架(ZIF-8)载黄芩苷|金属有机骨架复合磁性材料([email protected])|制备路线
- 交联环糊精金属有机骨架负载甲氨蝶呤缓释微粒|金属-有机多孔材料UiO-66负载黄酮苷类药物|齐岳
- FPGA test method takes mentor tool as an example
- Qt学习22 布局管理器(一)
- Nucleic acid modified metal organic framework drug carrier | pcn-223 metal organic framework encapsulated ad adamantane | zif-8 encapsulated adriamycin (DOX)
- Exercise 6-1 classify and count the number of characters
- Uniapp skills - dom display and hiding
猜你喜欢

Redis:字符串類型數據的操作命令

jvm-运行时数据区

MySQL data processing value addition, deletion and modification

7-9 find a small ball with a balance

QT learning 17 dialog box and its types

Metal organic framework MOFs loaded with non steroidal anti-inflammatory drugs | zif-8 wrapped Prussian blue loaded quercetin (preparation method)

Cross linked cyclodextrin metal organic framework loaded methotrexate slow-release particles | metal organic porous material uio-66 loaded with flavonoid glycosides | Qiyue

Exercise 6-1 classify and count the number of characters

7-11 calculation of residential water charges by sections

JVM object lifecycle
随机推荐
C library function - qsort()
[combinatorics] permutation and combination (examples of combinatorial number of multiple sets | three counting models | selection problem | combinatorial problem of multiple sets | nonnegative intege
Analysis of the characteristics of page owner
Redis:Redis的数据结构、key的操作命令
MySQL data processing value addition, deletion and modification
Common plug-ins for vite project development
金属有机骨架(MOFs)抗肿瘤药载体|PCN-223装载甲硝唑|UiO-66包载盐酸环丙沙星([email protected])
Doxorubicin loaded on metal organic framework MIL-88 DOX | folic acid modified uio-66-nh2 doxorubicin loaded [email
How to delete an attribute or method of an object
Metal organic framework material zif-8 containing curcumin( [email protected] Nanoparticles) | nano metal organic framework carry
Qt学习19 Qt 中的标准对话框(上)
“又土又穷”的草根高校,凭什么被称为“东北小清华”?
[acnoi2022] guess numbers
[ACNOI2022]猜数
Global event bus
TS code automatically generates JS
Exercise 9-1 time conversion
金属有机骨架MIL-88负载阿霉素DOX|叶酸修饰UiO-66-NH2负载阿霉素[email protected]纳米粒子
牛客网:过河卒
selenium 浏览器(1)