There are three types of replica set nodes:
Standard: a regular node that stores a complete copy of data and participates in voting. It may become a primary node;
Passive: stores complete copies of data and participates in voting. It
CMDStart MongoDBD: \ MongoDB \ bin \ mongod.exe -- bind_ip 127.0.0.1 -- dbpath D: \ MongoDB \ data -- Port 27017 -- directoryperdb -- logpath D: \ MongoDB \ logs \ db.txt -- logappend
Do not close the above cmd. Open a new cmdGo to MongoDBD: \
1. When you call ensureindex to create an index, you must ensure that no index has been created on the corresponding key before. Otherwise, if the statement is not executed, the index will retain the old version.
Example: we can create a common
Insert test data first:
For (VAR I = 1; I VaR num = I % 6;
DB. Test. insert ({_ ID: I, name: "User _" + I, age: num });
}
1. Common grouping query (http://www.my400800.cn)
DB. Test. Group ({key: {age: true}, initial: {num: 0}, $ reduce:
I. Initial KnowledgeMongoDB
MongoDBIs a distributed collection-oriented open source database., Stable version:Http://www.mongodb.org/downloads.The MongoDB server can be deployed onLinux,OS XAndWindowsSupported on the platform32Bit and64The default
In fact, the indexes in MongoDB are similar to relational databases. They are designed to improve the efficiency of query and sorting, and the Implementation Principles are basically the same. The keys (fields) in the set can be common data types or
Traditional relational databases are generally composed of three levels: database, table, and record. MongoDB is composed of databases and collections) and document objects. MongoDB has no concept of columns, rows, and links for tables in relational
MongoDB-related information
Mongolive: Real-Time MongoDB monitoring in chrome
Http://blog.nosqlfan.com/html/1964.html
Limitations and limitations of MongoDB
Http://blog.nosqlfan.com/html/3166.html
Admin Zone
I just got started with MongoDB. I don't want to write it this time. I feel very useful when I read several other blogs.
These are based on the. NET platform.
From the official MongoDB Website:
Basic Quick Start, ten minutes fast get, don't drag:
1. MongoDB sharding knowledge)
Replica set ):
The replica set enables each member (member) in the group to have the same data backup in different mongod instances, so that requests from the application server can be accessed (request visit)
Recently, the MongoDB nosql database was used in the log service design (I don't know the MongoDB point) because it is used for pure log storage, and the log volume is huge, with millions of logs, so we need to use its paging query.
However, LZ
ArticleDirectory
Find ()
Limit result set
Findone ()
Limit ()
Conditional operators , >= ,! =
$ Exists
Processing of null values
$ Mod
$ In & $ Nin
$ Not
$ Or
Array Operations
Count ()
Sort ()
Reprinted from http://my.oschina.net/zhzhenqin/blog/97268
At present, many tutorials on the internet talk about MongoDB sharding configuration, but most of them have not gone through practical practices and are reproduced randomly. In addition, the
MongoDB mobile chunks scriptAs the data volume increases, you may need to add shards. After adding shards, you need to move some of the data to the new shards. Originally, MongoDB supports automatic balancing (balancer, that is, automatically
MongoDB master-slave replication without verification, but one configuration role is master and oplog, And the other configuration role is slave.And the Master Ip port can be started.If it comes with verification, it will be troublesome.
MASTER:1.
This article is based on Kyle banker's MongoDB in action book. This section describes some basic knowledge and usage skills related to MongoDB indexes.
Index type
Although MongoDB indexes have the same storage structure, they are still divided into
For databases, a powerful management tool will greatly improve our work efficiency. For MongoDB, mongovue is such a tool. mongovue starts charging fees after version 1.0, so I still use version 0.9.7.2. It is enough for beginners. After installation
The cluster is composed of three servers (assuming the IP address is servera, serverb, and serverc) and uses the MongoDB replica set + sharding (replica sets + sharding) implements high reliability, high availability, and load balancing for Data
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