当前位置:网站首页>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}]})
边栏推荐
- 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.)
- JS shift operators (< <,> > and > > >)
- String substitution
- 如何查询淘宝天猫的宝贝类目
- MongoDB索引
- Leetcode (4) -- find the median of two positively ordered arrays
- Comprehensive evaluation of good-looking, easy-to-use and powerful handwriting note taking software: notability, goodnotes, marginnote, handwriting, notes writers, collanote, collanote, prodrafts, not
- Sendmail无法发送邮件及发送过慢解决
- 泰凌冲刺科创板:拟募资13亿 国家大基金与小米长江是股东
- Invalid Z-index problem
猜你喜欢

Scroll detection of the navigation bar enables the navigation bar to slide and fix with no content

Programming language: the essence of type system

Solution to failure or slow downloading of electron when electron uses electron builder to package

如何查询淘宝天猫的宝贝类目

X86 assembly language - Notes from real mode to protected mode

retrofit

556. 下一个更大元素 III

Exercise 10-8 recursive implementation of sequential output of integers

NPM install is stuck with various strange errors of node NPY

7-10 calculate salary
随机推荐
SSH access control, blocking the IP when logging in repeatedly to prevent brute force cracking
String reverse order
Selective sorting
愉悦资本新双币基金近40亿元完成首次关账
Exercise 6-2 using functions to sum special A-string sequences
[Jilin University] information sharing of postgraduate entrance examination and re examination
添加Zabbix计算类型项目Calculated items
C library function - qsort()
编程语言:类型系统的本质
Mysql多表查询 #子查询
7-14 sum integer segments (C language)
必贝特医药冲刺科创板:年营收97万亏损1.37亿 拟募资20亿
Invalid Z-index problem
7-18 finding the single root of polynomial by dichotomy
protobuf与grpc
MongoDB数据库入门的常用命令
Redis: operation command of string type data
Raft 协议
Redis:字符串類型數據的操作命令
7-7 12-24 hour system