当前位置:网站首页>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}]})
边栏推荐
- Redis: operation command of string type data
- Leetcode(4)——寻找两个正序数组的中位数
- 全文检索引擎Solr系列—–全文检索基本原理
- Leetcode(4)——尋找兩個正序數組的中比特數
- 使用并行可微模拟加速策略学习
- JS Part III
- Stop asking yourself if you are suitable for software testing
- 7-22 tortoise and rabbit race (result oriented)
- C library function - qsort()
- Leetcode (4) -- find the median of two positively ordered arrays
猜你喜欢
Polestar美股上市:5.5万台交付如何支持得起超200亿美元估值
Exercise 8-7 string sorting
7-8 overspeed judgment
Exercise 10-8 recursive implementation of sequential output of integers
7-15 calculation of PI
npm install卡住与node-npy的各种奇怪报错
一文了解微分段应用场景与实现机制
Why are grass-roots colleges and universities with "soil and poverty" called "Northeast small Tsinghua"?
JS matrix zero
Exercise 10-3 recursive implementation of exponential functions
随机推荐
泰凌冲刺科创板:拟募资13亿 国家大基金与小米长江是股东
The mail function of LNMP environment cannot send mail
Redis:Redis的数据结构、key的操作命令
Raft 协议
Exercise 10-1 calculate the sum of 1 to n using recursive functions
simpleParallax. JS (create poor visual effects for website pictures)
Sendmail can't send mail and it's too slow to send. Solve it
C library function - qsort()
Reflection -- basic usage
7-24 reduction of the simplest fraction (rolling Division)
NPM install is stuck with various strange errors of node NPY
Selective sorting
concat和concat_ws()区别及group_concat()和repeat()函数的使用
八大排序
How to bold text in AI
Thread.sleep和TimeUnit.SECONDS.sleep的区别
Exercise 10-3 recursive implementation of exponential functions
Solution to failure or slow downloading of electron when electron uses electron builder to package
Simulated access
etcd集群权限管理和账号密码使用