Operating System: CentOS 7.0 64-bit
MongoDB database version:mongodb-linux-x86_64-2.6.5
preparatory work: MongoDB Database Installation
Specific actions:
First, configure the MongoDB main Library
The following
This article is about MongoDB remote access configuration, not to mention the following, directly to see the detailed steps.
1, first modify the MongoDB configuration file to listen to all the extranet IP
Edit file: /etc/mongodb.conf
The revised
In the study of the index of MongoDB is to find a strange problem, set the text index to a string field, but did not use the index when querying. Like what:
Db.tomcat_access_logs.ensureIndex ({url: ' text '});
Db.tomcat_access.logs.find ({url: ' 1
Transferred from: http://www.ha97.com/4580.htmlThis picture is from Ricky Ho's blog, MongoDB Architecture (MongoDB Architecture), which is a very broad topic to listen to, but the author does have an analysis of MongoDB's internal-to-external
The logical structure of MongoDB is a hierarchical structure. Mainly consists of three parts: Document, Collection (collection), database. A logical structure is a logical structure used by user-facing users to develop applications using MONGODB.The
1. $incUsage: {$inc: {Field:value}}Function: Adds value to a field of a number> db.test1.update ({' name ': ' Wang '},{$inc: {age:1}})> db.test1.find ({' name ': ' Wang '}){"_id": ObjectId ("58662477fb6a734e8f45133f"), "name": "Wang", "age": +, "sex"
1. Query the document in the collection, you can use the command DB. Collection name. Find ({condition}), or use DB. Collection name. FindOne () query the first document2. Query the document in the collection to return some specific key values3.
1. Installing MongoDBMongoDB installation is very simple, just need to extract the downloaded MongoDB compressed files to any directory, and add the bin directory to the system's path environment variable can be2. Start MongoDBBefore you start
Replication set (Replica sets) is a master/slave replication mechanism for asynchronous synchronization of the same data, so that multiple machines have more than one copy of the same data, due to the automatic failover and recovery features, When
#mongodb安装 (3.4.0) #下载安装包, unzip Mkdir/data/mongodb Cd/data/mongodb mkdir Log conf Data bin Vim conf/mongod.conf #添加一下内容 port=27017Dbpath=/data/mongodb/dataLogpath=/data/mongodb/log/mongod.logFork=true#auth =true #添加管理员后取消注释, restart the
One: Master-slave replication1: First look at the model diagram2: From the graph above we can analyze the benefits of this architecture as follows: data Backup. data recovery. read/write separation.3: Let's practice the followingIn practical
I. INTRODUCTION to mongodb installation in the previous sectionInstalling php mongodb with macos2: laravel5.1 installation process http://www.golaravel.com/laravel/docs/5.1/#installationIII. laravel5.1 install mongodbComposer require
First, let's talk about the principle of Map-Reduce.For the basic principles of Map-Reduce, see the following figure:For the entire data processing process, see the official figure above. First, Query the data to be processed, map the data in the
Db. copyDatabase ("from", "to", "127.0.0.1: 16161 ");Replace the from library on 127.0.0.1. Copy to the to library.This has an additional benefit. That is, the from database may have deleted the data. We know that the disk space will not be released
Remove () function prototypeDb. collection. remove (, )Example The code is as follows:Copy code // Delete all dataDb. test. remove ()// Delete all data whose _ id is greater than 10Db. test. remove ({_ Id: {$ gt: 10 }}) // Delete a data entry
For example, you can query users whose age is greater than or equal to 20 and whose age is less than 30.Example The code is as follows:Copy code Db. user. find ({"age": {"$ gte": 20, "$ lt": 30 }}) Or query. To query multiple values of a key,
The official MongoDB is actually green without installation, http://www.mongodb.org/downloadsThe configuration file is not included by default. You can create one by yourself:Vi mongodb. conf: The code is as follows:Copy code Dbpath
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