These days to learn a bit mongodb, now take a note.
1. First Installation
(preferably installed in the root directory, and then manually build a DB folder)
Installation is complete because MongoDB is required to start manually, locate the Bin
Last blog We lied about what is nosql. We have a comprehensive understanding of NoSQL, starting from this blog, will lead everyone into the MongoDB world, we begin to introduce MongoDB.
What is MongoDB?
We look directly at the MongoDB official
The secondary node in the replica set is not readable by default. in applications where there is less write-read, the replica sets is used to achieve read-write separation. By specifying Slaveok at the time of connection, or by specifying the
MongoDB uses bson as the file data storage and network transmission format, first impression
bson is a bit like blob , : Mongo database bson internal . This means MongoDB Yes " reached " bson object, or even
MongoDB's data import method is similar to that of MySQL.
------------------------------------------------------------------------------
Data export:
Mongodump -- Host XXXXX -- Port 27017 -- username -- password passwd -- out/mnt/dbbak
In this
Basicdbobject cannot be put normally. Cause and solution of put Value failure
Basicdbobject OBJ=NewBasicdbobject ();
OBJ. Put (Key, value );
The error occurs because the key is unique.
If the key is the same, it overwrites the previous
By default, users can log on to apsaradb for MongoDB without entering the user name and password. However, for the sake of security, we still need to set the user name and password for it. This document describes how to operate the username and
After reading some information, I only need to know how to query and use MongoDB. This is enough.
On the left is the MongoDB query statement, and on the right is the SQL statement. It is easy to use.
DB. Users. Find () Select * from users
DB. Users.
This is the automatic deployment of the standalone version. For manual deployment, refer to my other article:
Http://blog.csdn.net/sheismylife/article/details/6737127
First download the mongodb-linux-x86_64-2.2.0.tgz, decompress it and put it under
Each MongoDB server supports multiple databases. Each database is relatively independent. For security purposes and convenience of management, the database data is also stored independently.
Mongo metadata
In the MongoDB database, the
Mapreduce is a programming model used for parallel operations on large-scale datasets (larger than 1 Tb. Concepts such as map and reduce are borrowed from functional programming languages, there are also features borrowed from Vector programming
Reprinted from http://www.cnblogs.com/spnt/
After the entire MongoDB architecture has been deployed, it is time to truly test the capabilities of the architects: how to select the chip key.
If you select an inappropriate chip key, it may cause your
Document directory
Download
Unzip and install
Create a data directory
Run and connect to the MongoDB Server
Further study
Original address: http://tq-zone.appspot.com/mongodb_quickstart_windows
Download
32-bit version
64-bit
I saw a PPT about MongoDB deep indexing a few days ago.
MongoDB indexing: the details
You can see the range and consistency of compound indexes from the beginning and end. On the 129th page of the PPT, review this example. insert nine data records
Ruby connection to MongoDB
To connect to MongoDB in Ruby, you need to use the Mongo module. This module can be installed through the gems program that comes with Ruby.
$ gem update --system$ gem install mongo$ gem install bson_ext
The Mongo module
Mongodb is a database server that runs on the frontend or backend and waits for a connection from a user. When you start mongodb, you will see something similar to the following:
~/$ ./mongod## some logging output#Tue Mar 9 11:15:43 waiting for
The MongoDB set is essentially the name of a group of documents. You can think that they are basically equivalent to tables in relational databases.
Overview
A MongoDB collection is a collection of bson documents. These documents usually have the
Document directory
1. Add an arbiter to the original Master/Slave Mechanism
2. One Primary is used for writing, multiple Secondary is used for reading and one Secondary is used for backup
3. Classic MongoDB configuration. The upper layer is
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