[MongoDB] The high query operation of MongoDB (2), mongodboperation

Source: Internet
Author: User
Tags mongodb server

[MongoDB] The high query operation of MongoDB (2), mongodboperation

In the last blog, there are three query condition to be described. In the blog, we will continue to what we have leaned 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 will find the data according the type of bson field. For example:

The following picture is the type of bson type.



[MongoDB] how to stop a MongoDB Server

If the server runs on the terminal as a foreground process, press Ctrl-C. Otherwise, use the kill command to send a signal. If the PID of mongod is 10014, you can use kill-2 10014 (SIGINT) or kill 10014 (SIGTERM ).
When mongod receives the SIGINT or SIGTERM, it exits. That is to say, it will wait until the current operation or file pre-distribution is completed (it takes some time), close all open connections, refresh the cached data to the disk, and finally stop. Do not send SIGKILL (kill-9) to a running MongoDB instance ). This will cause the database to be shut down directly, and the previous steps will be ignored, which will damage the data file.
 
Would NoSql like MongoDB be able to store only text information but not binary information?

MongoDB is a document-based storage database. Its storage is provided to the file storage system in the operating system. Therefore, mongodb can be stored as long as it is available in the file system.

If you want to save some binary big data files, you can use the GridFS data structure.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.