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