当前位置:网站首页>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: commandes d'action pour les données de type chaîne
- Exercise 10-8 recursive implementation of sequential output of integers
- 556. 下一个更大元素 III
- Polestar美股上市:5.5万台交付如何支持得起超200亿美元估值
- 7-23 currency conversion (using array conversion)
- Exercise 10-2 recursive factorial sum
- Generate directories from web content
- Programmable logic device software testing
- 7-17 crawling worms (break exercise)
- Global event bus
猜你喜欢

7-15 calculation of PI

Mysql多表查询 #子查询

Programmable logic device software testing

Why is this error reported when modifying records in the database

Polestar美股上市:5.5万台交付如何支持得起超200亿美元估值

Thinking about the arrangement problem in the backtracking problem (leetcode questions 46 and 47)

JS input number and standard digit number are compared. The problem of adding 0 to 0

Doris学习笔记之数据表的创建

FPGA test method takes mentor tool as an example

分布式事务(Seata) 四大模式详解
随机推荐
SSH access control, blocking the IP when logging in repeatedly to prevent brute force cracking
[clean up the extraordinary image of Disk C]
泰凌冲刺科创板:拟募资13亿 国家大基金与小米长江是股东
ShowMeBug入驻腾讯会议,开启专业级技术面试时代
虽然不一定最优秀,但一定是最努力的!
Redis:Redis的数据结构、key的操作命令
Find the sum of the elements of each row of the matrix
x86汇编语言-从实模式到保护模式 笔记
NPM install is stuck with various strange errors of node NPY
Concat and concat_ Ws() differences and groups_ Use of concat() and repeat() functions
PCB中常用快捷键
剑指 Offer 28. 对称的二叉树
Exercise 8-2 calculate the sum and difference of two numbers
GRPC的四种数据流以及案例
Exercise 9-3 plane vector addition
适用于XP的DDK
关于回溯问题中的排列问题的思考(LeetCode46题与47题)
Programmable logic device software testing
JVM垃圾回收机
Doris学习笔记之数据表的创建