当前位置:网站首页>Mongodb query and projection operators
Mongodb query and projection operators
2022-07-25 23:17:00 【Intern Sen】
One 、 Compare
mongodb Common comparison query operators :
| name | describe |
|---|---|
$eq | Match the value equal to the specified value , namely = |
$ne | Matches all values that are not equal to the specified value , namely != |
$gt | Match values greater than specified , namely > |
$gte | Match values greater than or equal to the specified value , namely >= |
$lt | Match values less than specified , namely < |
$lte | Match values less than or equal to the specified value , namely <= |
$in | Matches any value specified in the array |
$nin | Does not match any of the values specified in the array |
db.people.find( {
"name": "xiaoming" } ); // : be equal to
db.people.find( {
"name": {
$eq: "xiaoming"} } ); //$eq be equal to
db.people.find( {
"name": {
$ne: "xiaoming"} } ); //$ne It's not equal to
db.people.find( {
"age": {
$gt: 18 } } ); //gt Greater than 18
db.people.find( {
"age": {
$gte: 18 } } ); //gte Greater than or equal to 18
db.people.find( {
"age": {
$lt: 30 } } ); //lt Less than 30
db.people.find( {
"age": {
$lte: 30 } } ); //lte Less than or equal to 30
db.people.find( {
qty: {
$in: [ 5, 15 ] } } );
db.people.find( {
qty: {
$nin: [ 5, 15 ] } } );
Two 、 Logic
| name | describe |
|---|---|
$and | Join query clauses logically AND All documents that match both clauses will be returned . |
$not | Reverse the effect of a query expression , And return the document that does not match the query expression . |
$nor | Join query clauses logically NOR All documents that do not match the two clauses will be returned . |
$or | Join query clauses logically OR All documents that meet the conditions of any clause will be returned . |
2.1 $and
2.2 $not
2.3 $nor
2.4 $or
3、 ... and 、 Elements
| name | describe |
|---|---|
$exists | Match the document with the specified field . |
$type | If the field is of the specified type , Then select a document . |
3.1 $exists
3.2 $type
Four 、 assessment
5、 ... and 、 Geographical space
6、 ... and 、 Array
7、 ... and 、 Bitwise
8、 ... and 、 notes
Nine 、 Projection operator
To be added ...
边栏推荐
- The fifth article in the series of radar Fundamentals: the function of radar modulation style
- 互联网协议之 IPFS
- EasyExcel实用技巧
- Which securities firm is the best and safest for beginners to open an account
- Shanghai Second Polytechnic University - Health Daily autocheck
- Source code of YY music wechat applet imitating Netease cloud music
- PCL basic operation Encyclopedia
- Recommend short videos every week: more and more smart devices need collaboration, posing a greater challenge to the development of the Internet of things?
- Design of Butterworth filter and drawing of amplitude frequency characteristic curve
- Design of regular expressions
猜你喜欢

内存分页与调优,内核与用户空间

How to obtain the cash flow data of advertising services to help analyze the advertising effect?

Take away applet with main version of traffic / repair to add main access function of traffic

Details of notification (status bar notification)

MVVM model

PHP JSON variable array problem

栈与Stack类

The new UI people help task help PHP source code with a value of 1500 / reward task Tiktok Kwai headline like source code / with three-level distribution can be packaged applet

wordpress去掉网站发布时间

Firewall command simple operation
随机推荐
About using NPM command under the terminal, the installation error problem is solved (my own experience)
7-1 understand everything
Bind class style and bind style style
Redis过期键的删除策略[通俗易懂]
动态内存管理
Sichuan cuisine menu (I)
Discuz magazine / news report template (jeavi_line) utf8 GBK / DZ template download
The difference between MySQL clustered index and non clustered index
Apple CMS V10 template /mxone Pro adaptive film and television website template
Panzer_ Jack's personal blog founding day
HJ7 取近似值
赋能合作伙伴,亚马逊云科技如何落地“扶上马,送一程”?
r语言绘图参数(R语言plot画图)
Ma Tiji Wanmin hall Chef
[PTA] 7-24 minimum fraction (15 points)
Secure code warrior learning record (III)
EasyExcel实用技巧
Ssh server CBC encryption mode vulnerability (cve-2008-5161)
Notification(状态栏通知)详解
Longitude and latitude and its transformation with coordinate system