当前位置:网站首页>Common commands for getting started with mongodb database
Common commands for getting started with mongodb database
2022-07-03 14:22:00 【Rice field prospector】
Select switch database :use articledb
insert data :db.comment.insert({bson data })
Query all the data :db.comment.find();
Condition query data :db.comment.find({ Conditions })
Query the first record that meets the criteria :db.comment.findOne({ Conditions })
Query the first few records that meet the criteria :db.comment.find({ Conditions }).limit( Number of pieces )
Query qualified skipped records :db.comment.find({ Conditions }).skip( Number of pieces )
Modifying data :db.comment.update({ Conditions },{ Revised data })
db.comment.update({ Conditions },{$set:{ To modify the field of the part : data })
Modify the data and add a field value automatically :db.comment.update({ Conditions },{$inc:{ Self increasing field : Step value }})
Delete data :db.comment.remove({ Conditions })
Statistics query :db.comment.count({ Conditions })
Fuzzy query :db.comment.find({ Field name :/ Regular expressions /})
Conditional comparison operations :db.comment.find({ Field name :{$gt: value }})
Contains the query :db.comment.find({ Field name :{$in:[ value 1, value 2]}})
db.comment.find({ Field name :{$nin:[ value 1, value 2]}})
Conditional join query :db.comment.find({$and:[{ Conditions 1},{ Conditions 2}]})
db.comment.find({$or:[{ Conditions 1},{ Conditions 2}]})
边栏推荐
- 一文了解微分段应用场景与实现机制
- 战略、战术(和 OKR)
- PCB中常用快捷键
- Scroll detection of the navigation bar enables the navigation bar to slide and fix with no content
- Leetcode(4)——尋找兩個正序數組的中比特數
- Although not necessarily the best, it must be the hardest!
- Configure stylelint
- ShowMeBug入驻腾讯会议,开启专业级技术面试时代
- GRPC的四种数据流以及案例
- 7-18 finding the single root of polynomial by dichotomy
猜你喜欢
JS Part 2
TS code automatically generates JS
好看、好用、强大的手写笔记软件综合评测:Notability、GoodNotes、MarginNote、随手写、Notes Writers、CollaNote、CollaNote、Prodrafts、Noteshelf、FlowUs、OneNote、苹果备忘录
Understanding of closures
Eight sorts
Exercise 8-8 moving letters
Doris学习笔记之数据表的创建
NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
7-7 12-24 hour system
allegro,orcad, net alias,port,off-page connector之间的异同点和如何选取
随机推荐
中国锂电池电解液行业市场专项调研报告(2022版)
Redis: operation command of string type data
JS get DPI, PX to cm, cm to PX
Redis:字符串类型数据的操作命令
Exercise 10-3 recursive implementation of exponential functions
SSH access control, blocking the IP when logging in repeatedly to prevent brute force cracking
Mysql多表查询 #子查询
添加Zabbix计算类型项目Calculated items
X86 assembly language - Notes from real mode to protected mode
使用并行可微模拟加速策略学习
x86汇编语言-从实模式到保护模式 笔记
MongoDB索引
Sendmail can't send mail and it's too slow to send. Solve it
JS first summary
7-9 find a small ball with a balance
Sendmail无法发送邮件及发送过慢解决
Canvas utility library fabric JS user manual
7-22 tortoise and rabbit race (result oriented)
etcd集群权限管理和账号密码使用
Thinking about the arrangement problem in the backtracking problem (leetcode questions 46 and 47)