【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 following picture depicts.

Condition Expression

1. <, <=, >, <=  is correspondent to ‘$lt’,‘$Ite‘, ‘$gt‘ and ‘$gte‘

2. $all

This operation is analogous to the $in operation. But the difference is that $all operation requires every elements in the array to be included in the return result.

3. $exists

$exists operation check whether one field exists.

时间: 2024-10-05 18:53:36

【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(三)

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

【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.

【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

基于C#的MongoDB数据库开发应用(2)--MongoDB数据库的C#开发

在上篇博客<基于C#的MongoDB数据库开发应用(1)--MongoDB数据库的基础知识和使用>里面,我总结了MongoDB数据库的一些基础信息,并在最后面部分简单介绍了数据库C#驱动的开发 ,本文继续这个主题,重点介绍MongoDB数据库C#方面的使用和封装处理过程,利用泛型和基类对象针对数据访问层进行的封装处理. 前面介绍到,当前2.2版本的数据库C#驱动的API,支持两种不同的开发接口,一个是基于MongoDatabase的对象接口,一个是IMongoDatabase的对象接口,前者中

【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/

基于C#的MongoDB数据库开发应用(1)--MongoDB数据库的基础知识和使用

在花了不少时间研究学习了MongoDB数据库的相关知识,以及利用C#对MongoDB数据库的封装.测试应用后,决定花一些时间来总结一下最近的研究心得,把这个数据库的应用单独作为一个系列来介绍,希望从各个方面来总结并记录一下这个新型.看似神秘的数据库使用过程.本文是这个系列的开篇,主要介绍一些MongoDB数据库的基础知识.安装过程.基础使用等方面. MongoDB是一款由C++编写的高性能.开源.无模式的常用非关系型数据库产品,是非关系数据库当中功能最丰富.最像关系数据库的数据库.它扩展了关系型