【MongoDB】The high query operation of MongoDB(二)

In the last blog, there are three query condition to be described. In the blog, we will continue to what we have leant in the last blog.

1 $mod

‘$mod‘ operation is able to make us to do simple mod operation, but is no need to use where sentence.

\

2. $ne, $in, $nin

‘$ne’ means not equal. ‘$in‘ is same as key word ‘in‘ in relationship. $nin is opsitive to ‘in‘

3.$or and $nor

durning the mutiple conditions, then result will be return that it only matches one condition among condition.

as for $noe, which is in contrast with $no, let‘s learn it from the following the picture.

4. $size

$size operation will query result whose size is equailvant to size of input.

5. $where

6. $type

$type will find the data according the type of bson field. For example:

The following picture is the type of bson type.

时间: 2024-10-25 11:32:20

【MongoDB】The high query operation of MongoDB(二)的相关文章

【MongoDB】The basic operation of Mongodb, Insert\Query\Delete\Update

1, Insert MongoDB is database storing document object, the type of which is called Bson.(like JSON); Example:  // document defination Now after using command[db.posts.insert(doc)], you will insert record successfully if seeing the The following pictu

【MongoDB】The high Query operation of MongoDB(一)

In the last blog, we talked about the basic operation of MongoDB, including insert, query, remove and update. Now in this blog, we will further hava a good understanding of  querying operation. At first, let's create 1000 recors for testing. As the f

【MongoDB】The high query operation of MongoDB(三)

1, Sort Needless to say, mongodb also support to sort data. THe positive one means sorting by asc order and negetive means by desc. 2. Group The grammar of group: Description Of Argument: key: The field need to group cond: query condition Initial: in

【MonogoDB】The high update operation of MongoDB

In the last four blog, we talked about the high query operation of mongodb. Now in this blog let's know about the high update operation about monodb. 1. Save as for save(), whose function is to update the existing record and to create the new record.

MongoDB - MongoDB CRUD Operations, Query Documents, Project Fields to Return from Query

By default, queries in MongoDB return all fields in matching documents. To limit the amount of data that MongoDB sends to applications, you can include a projection document in the query operation. Projection Document The projection document limits t

MongoDB - MongoDB CRUD Operations, Query Documents, Query for Null or Missing Fields

Different query operators in MongoDB treat null values differently. The examples on this page use the db.collection.find() method in the mongo shell. To populate the users collection referenced in the examples, run the following in mongo shell: db.us

MongoDB权威指南第二版学习笔记二

数据类型 MongoDB在保留JSON基本键/值对特性的基础上,添加了其他一些数据类型. null null用于表示空值或者不存在的字段:{“x”:null} 布尔型 布尔类型有两个值true和false {“x”:true} 数值 shell默认使用64位浮点型数值. {“x”:3.14} 或 {“x”:3} 对于整型值,可使用NumberInt类(表示4字节带符号整数)或NumberLong类(表示8字符带符号整数) {“x”:NumberInt(”3”)} {“x”:NumberLong(

【MongoDB for Java】Java操作MongoDB

开发环境: System:Windows IDE:eclipse.MyEclipse 8 Database:mongoDB 开发依赖库: JavaEE5.mongo-2.5.3.jar.junit-4.8.2.jar 一.准备工作 1. 首先,下载mongoDB对Java支持的驱动包 驱动包下载地址:https://github.com/mongodb/mongo-java-driver/downloads mongoDB对Java的相关支持.技术:http://www.mongodb.org/

MongDB基础学习(七)—— 【MongoDB for Java】Java操作MongoDB

[MongoDB for Java]Java操作MongoDB 开发的产品为了融资,不停得改版,从第一版到现在最新版本,最后发现公司发展方向都变了,有最初电子商务改成VR内容提供者(没办法,要别人钱,就得按照别人的规划的战略走).本来本章节会放到后面再做讲解,无奈,部门需要做一次培训任务,我就想到拿Java操作MongoDB作为培训内容,开发环境和依赖jar如下: (1)开发环境: System:Windows IDE:eclipse Database:mongoDB2.6 Maven:apac