followed by a parameter, 0 means the display is not displayed in the query Results 1 representsFor example: View only name and gender:Db.stu.find ({},{name:1, gender:1})//_id is displayed by default, if it is not displayed _id need special designation//projection set to 1 except _id other parameters are displayed by defaultdo not show _id:db.stu.find ({},{_id:0,name:1})3.8 Sorts sort ():db. Collection. Find (). sort ({field 1:1, field 2:-1})//Specify field sort, 1 for ascending, 1 for descendin
Tags: http io os ar for SP file div onThere are a lot of documents to install, you can refer to this article:
http://www.mkyong.com/mongodb/how-to-install-mongodb-on-mac-os-x/2 questions you may encounter after installation.
1. Let Mongod run the command in the background to start MONGO Mongod has a parameter--fork can make MONGO run in the background, but you must also set the--logpath parameter to
before inserting--drop drop each collection before import--oplogreplay Replay oplog for Point-in-time restore--oploglimit Arg include Oplog entries before the provided Timestamp (seconds[:ordinal]) during the Oplog replay; the ordinal value is optional--keepindexversion don ' t upgrade indexes to newest version--nooptionsrestore don ' t restore collection options--noindexrestore don ' t restore indexes--w Arg (=0) Minimum number of replicas per write
Actual operation:MongoDB B
A new requirement was received in the previous two days to monitor the maximum number of MongoDB connections, memory usage, etc. in the Linux shell script.
But I do not understand the Linux Shel, just a few simple common Linux operations, as long as a wild search, and finally many attempts to finally get these values.
Label:1. Install the MONGBODB installation package (open source free yo) Under the Mac Brew install MongoDB can be installed to wait a while, about 200M 2. CD to Mongbodb folder-if installed with homebrew /usr/local/cellar/mongodb/(version number) 3. Create a Folder mkdir data mkdir Log mkdir conf 4. Writing the startup file CD conf Vim mongod.conf Port = 54321 DBPath = Data LogPath = Log/mongod.log Fork =
1. installation environment:
Oracle Linux 5.9
2. Download and install:
For how to install the yum command in Linux, see:
Check whether the yum source has mongodb:
[Root @ bakdbserver ~] # Yum info mongo-10gen
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
You can use up2date -- register to register.
ULN support will be disabled.
Error
Tags: div help style open process link targe Ann SuccessOne, download MongoDB file (1) Various versions: Https://www.mongodb.org/dl/linux/x86_64 (2) Baidu cloud Download Link: Https://pan.baidu.com/s/1JEK8ybzdyeia4olc96tR-A Password: bg66 Second, unzip the file (upload to the Linux process omitted) Third, through the command line:
CD
1,MONGODB introduction;MongoDB is a high-performance, open-source, modeless document-based database that is a popular one in the current NoSQL database. It can be used in many scenarios to replace the traditional relational database or key/value storage methods. MONGO using C + + developmentCharacteristics:
High performance, easy to deploy, easy to use, easy to store data. The main features are:
, to do a certain IP access frequency limit, to avoid being reasonable use of attacks.Third, appendixRecommend a website: zooomeye, Zhong Eye, is a search engine for cyberspace. His crawler is dedicated to scanning the server on the network, for example, he got an IP, began to detect which ports on the IP open, using some methods to obtain important open services information.With him, you can make a simple vulnerability scan of your own server (provided that he has updated your server's informat
Linux limits mongodb memory usage for multiple instances: you can bind a cpu to prevent mutual interference between multiple instances. The memory of www.2cto. commongodb can also be restricted to the master to prevent all memory from being occupied by one instance. # Tudou@ B2C .xiaomi.com [plain] ulimit-s4096 amp ;...
Linux limits
1, download MongoDB, without compiling (if HTTPS does not, can be replaced by HTTP)wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.1.tgzTAR-ZXVF mongodb-linux-x86_64-2.6.1.tgzMV
Tags: GPO inux use command log data using Enter CommSome friends say you can close mongodb with the following command:Killall MongoDB#or-9 MONGO-pid The above method does turn MongoDB off, but it's not the right thing to do, and MongoDB provides a command to shut down the database:First you need to go into the
Tags: LAN for installation art database settings restart IMG MongodMongoDB Start Stop method The official website installs the introduction to still have the way that starts to stop 1 start sudo service Mongod start 2 stop sudo service Mongod stop 3 restart sudo service mongod restart 4 Viewing status sudo service Mongod status or view the process Ps-ef | grep Mongod or view the port number status NETSTAT-LANP | grep 27017 5 connections Mongo 6 Viewing the database configuration Less/etc/m
This article mainly describes the Python monitoring of Linux memory and write the relevant information of MongoDB, the need for friends can refer to the following
(Need to install Psutil to get server resources, as well as Pymongo drivers) #pip Install Psutil
#pip Install Pymongo#vim memory_monitory.py
The file contents are as follows
#!/usr/bin/env python#-*-coding:utf-8-*-import psutilimport socketimpo
Linux to increase the expansion module, first download the source package from the Http://pecl.php.net/package/mongo, where the download is mongo-1.2.12.tgz, then perform the installation steps
Tar zxvf mongo-1.2.12.tgzCD mongo-1.2.12
Prepare the compilation environment/usr/local/webserver/php/bin/phpize./configure--with-php-config=/usr/local/webserver/php/bin/php-configMakeMake installVi/usr/local/webserver/php/etc/php.ini
Add extension = mongo.so
# method 1: (recommended)#--fork option will notify Mongod to run in the background/path/to/mongodb_dir/bin/mongod--logpath/path/to/file.log--logappend--fork# Method 2:# REDIRECT output to the File.log file# Put the process in the background run/path/to/mongodb_dir/bin/mongod >>/path/to/file.log # can also run like this (do not log logs)# because all redirected bin files/dev/null information will be discarded/path/to/mongodb_dir/bin/mongod >>/dev/null Mongo
PHP operating MongoDB module linux, detailed introduction (7), mongodblinux
In linux, why did I quit immediately after I got connected to mongodb?
Connect failed, not connected at all, not just connected and exited.Check whether mongod is running normally. Check log, process, and port.How can I write mu
Linux MongoDBinstallationPreface:Official Reference manual: https://docs.mongodb.org/manual/?_ga=1.41355425.2024551820.1440643898You can also download the corresponding PDF version, or find the Chinese version online (mongodb_ authoritative Guide _ Chinese version), find the Linux platform installation introduction1. Installation Environment centos-5.10-x86_642. Mon
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.