1. Download MongoDB
2. Extract files to a directory, and then rename: [Root@localhost var]# tar-xzvf Mongodb-linux-i686-2.0.1.tar [root@localhost var]# MV Mongodb-linu x-i686-2.0.1/mongodb/Bin Mongod is the MongoDB server process, MONGO is its
This article originates from me in the Infoq Chinese station original article, the original address is: http://www.infoq.com/cn/news/2013/11/mongodb-things
Henrique Lobo Weissmann, a software developer from Brazil, is a co-founder of Itexto, a
Previously designed a label system based on Lucene, in the case of a small amount of data and the amount of concurrency can be used reluctantly, more than 1 million of the query will be more than 1 seconds, ranking is affecting a lot of performance,
You need to first install Python and MongoDB, where MongoDB's installation references the previous blog post.
In the official parlance, it is recommended to use the PIP to install the MongoDB python driver Pymongo
First need to install PIP, may
One: Problem description
I enter MongoDB's machine IP and port number in the browser: http://192.168.6.70:27017/
Page appears:
It looks like your are trying to access MongoDB over HTTP on the native driver port.
As shown in figure:
Two:
Lead: db.keyword.distinct ("keyword"). length
As follows:
Db.keyword.distinct ("keyword"). length
View the total number of records in the keyword table that do not duplicate keyword fields
This method is not seen in the official document, try to
Millions of of the data in the database, processing may be slow, so it is simple to build a smaller structure of similar tables, test data
/* 0 */
{
"_id": ObjectId ("54fe73e36e26d21dc4391bdb"),
"Create_date": Isodate ("2014-07-26t13:57:18z"),
One: Problem description
I enter MongoDB's machine IP and port number in the browser: http://192.168.6.70:27017/
Page appears:
It looks like you is trying to access MongoDB over HTTP on the native driver port.
As shown in figure:
Two:
An example of modeling a customer and its multiple address relationships
Use normalized ( referenced ) and non-normalized ( inline ) storage, respectively:
1, standardized storage:
(In a normalized data model, the address document contains a
Exception in thread "main" java.lang.IllegalAccessError:tried to access method Org.bson.types.ObjectId. (III) V from class Org.mongojack.internal.stream.ObjectIdConvertor.
The cause of this problem is caused by a jar version
1 Start the MongoDB service (also specify the folder that holds the "database")
MongoDB can only be used when the service is started by MongoDB, usually with a command window open, enter the following command to start the service (you can also
Title Resolve MongoDB E11000 Duplicate key error collection: **.customer index:id dup key,Or the MongoDB atomicity problem, the code is as follows:
Collection.updateone (
New Document () Append ("_id", _id). Append ("$isolated", 1),
New
1. Start MongoDB in master mode first2. Import the data files of the main library:/data/mongodb-3.0.12/bin/mongorestore/data/tmp/mongodbbak/3. Close the Mongdb:Kill-2 PID4. Modify the configuration file, set the boot from the mode, and set the main
1. Start MongoDB service without access controlsudo service Mongod start2. Connect to an instanceMONGO--port 27017Specify additional command-line options to connect the MONGO shell to the deployment MongoDB server, such as--host3. Created User
Recently the company to do a project to use MongoDB, below to introduce the Mongorepository interface.You can analogy Hibernate's jpa,mongorepository is a basic interface that a springdata provides for operations such as add-and-revise checks and
About MongoDBMongoDB is a cross-platform, document-oriented database. Can achieve high performance, high availability, and can easily scale. is a distributed file storage based open source database system, in the case of high load, add more nodes,
Overview of MongoDB Replication Sets
A replica set is an additional copy of the data that is the process of synchronizing data across multiple servers, and the replication set provides the sink to add data availability, and the benefits of
Overview of MongoDB Replication Sets
A replica set is an additional copy of the data that is the process of synchronizing data across multiple servers, and the replication set provides the sink to add data availability, and the benefits of
1. Basic query ① Method Find (): Query db. collection name. Find ({conditional document}) ② method FindOne (): Query, returns only the first DB. Collection name. FindOne ({conditional document}) ③ method Pretty () : Formats the result of the DB.
Note: This environment only applies to the CENTOS6 version of the system, version 7 does not need to be installed glibc#!/usr/bin/env python#coding:utf-8import osimport zipfileimport tarfileimport shutilline = Os.linesepscript_path = OS.GETCWD ()
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