To back up a database,
Mongorestore-d db/path/to/back_up
For example:
mongodump-d Bookstore-o/data01/db_backup/
This command will dump all of the DB collectionrecover data from a backup folder
Mongorestore-d
Common JavaScript statements
Copy Code code as follows:
Db.getsiblingdb ()
Db.getcollectionnames ()
Db.getcollection ()
Db.printcollectionstats ()
Running JavaScript scripts on the MONGO shell
To switch a database:
The production environment instance frequently OOM, the investigation discovery mainly by some $near query causes, the query resembles follows, in which the LATLNG field has established 2d index.
{"Find": "UserData",' Filter ': {"LATLNG": {"$near":
Copyright notice: This article by the Comte rain original article, reproduced please indicate the source:Article original link: https://www.qcloud.com/community/article/136Source: Tengyun https://www.qcloud.com/communityMongoDB single-instance mode,
Linux under MongoDB Service installation
MongoDB is a database based on distributed file storage. Written by the C + + language. Designed to provide scalable, high-performance data storage solutions for Web applications. MongoDB is a
This article translated from: https://docs.mongodb.com/manual/reference/sql-aggregation-comparison/Because I am also learning MongoDB, the project to use aggregation, see the document this good translation (for reference only)The aggregation
MongoDB version 3.2 (currently up-to-date), the demo is the Linux under the MongoDB authorization authenticationFirst logon does not start authorization (MONGO default does not
Premise: The Shard server is not set from the service and equalization service, only the primary server;The current test is on the same physical machine for all servers.1. Test environment: 192.168.1.55.2. Test mode: Stand-alone.3. Service: Shard
Db.tb1.find ()//query all, use it to view the next page.Db.tb1.find ({"Age": 1})//Check the records of Ages ==1Db.tb1.find ({},{"age": 1})//Check records for ages ==1Db.tb1.find ({"name": {$all: ["A", "B"]}})//query name contains a/b
Installing MongoDB with Windows environmentFirst download the MongoDB installation package or the ZIP unpacking packageGo to the official website to download https://www.mongodb.com/download-center?jmp=nav#communityI am using the installation
Before we discussed the MongoDB "adding and deleting", to know that our additions and deletions are inseparable from the query expression, so the query expression in MongoDB is very important. About the query actually we just introduced to a small
after upgrading the company MongoDB, unable to start . To view the log, the following appears:2016-11-29t14:22:09.382+0800 E NETWORK [Initandlisten] Failed to unlink socket File/tmp/mongodb-27029.sock errno:1 Opera tion not permitted650) this.width=6
Log on to MongoDB shell and switch to the admin databaseMongoUse adminCreate administrator userDb. createUser ( {User: "yourusername ",Pwd: "password ",Roles: [{role: "userAdminAnyDatabase", db: "admin"}] })Modify/etc/init. d/mongod and restart
1. Distributed read operationsThis section describes how sharded clusters and replica sets affect read operation performance.1.1 sharded cluster read operationsThe sharded cluster allows data to be split into different mongod instances in the
Today, my colleague asked me to enable remote access to mongodb, so they can test it. If you have not installed mongodb, please refer to my article Centos to install MongoDB.System: centos 5.x1. Modify the mongodb configuration fileVi/etc/mongod.
Nginx automatic startup scriptSave the following script as an nginx file and put it in/etc/init. d/nginxThen you can use/Etc/init. d/nginx start command to start nginx/Etc/init. d/nginx stop command to stop nginx/Etc/init. d/nginx restart command
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