First of all, my system is a ubuntu11.04,64 bit system, the following installation may need to modify their own system conditions.
1. Download MongoDB installation package
$wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.0.0.tgz
2.
MapReduce is a software framework released by Google in 2004 to support distributed computing for large-scale data, see here for details.
MongoDB is an open source document-oriented NoSQL database system, written in C + +, please see here for
MongoDB: Database, collection, document, where "set" is the corresponding relational database "table", "document" corresponding to the "line".1, first of all, download the MongoDB Java-supported driver package
org.mongodb
A 2d Sphere Index supports queries that calculate geometries on A earth-like sphere. The index supports data stored as both Geojson objects and as legacy coordinate. The index supports legacy coordinate pairs by converting the ' data to the '
Due to business needs, the company recently transferred part of the data to the MongoDB database.
After deploying the MongoDB database with the corporate DBA, we started our Java Connection MongoDB practice
Before you start, recommend two IDE tools
1. Download mongodb:http://download.csdn.net/detail/swazer_z/9314681 can also go to the official website to download the latest installation package: Https://www.mongodb.org/downloads
2. Extract files to a directory, and then rename:
When you start a MongoDB service under Linux, the following problems often occur:My solution is:1. First, enter the MongoDB directory under the/data/db/directory, there will be file Mongod.lock, delete this file.2. Use command: Netstat-anp|more to
Download Installation First
MongoDB website Download Select window version
The second step is to install
Note The installation directory, my installation directory is D:\Program Files (x86) \mongodb
Step three: Start
Open the cmd window and enter
first, write in front of the words
MongoDB supports asynchronous data replication between different services to implement failover (failover, failover, failback) and redundancy (data redundancy). At the same time, only one service node (primary or
1.MongoDB after the introduction of read and write separation, restart service time is longer, you can see the following printing:Your mercy for graceful operations on workers are secondsSearch related data discovery can reduce the service restart
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
Data persistence: Persistent Data persistence method: 1. File read/write 2.cookie, server stored in the client's data, the client will automatically send the cookie to the server (the cookie is stored in the HTTP header), Session + Cookie
On the left is the MONGODB query statement, and the right is the SQL statement. Compared with the use, very convenient.
Db.users.find () SELECT * from Users
Db.users.find ({"Age": +}) SELECT * from the users where age = 27
Db.users.find ({"username":
The condition operators in MongoDB are:
· (>) Greater than-$GT
· (
· (>=) greater than or equal to-$gte
· (
We used the database name "Runoob", our collection name is "Col", the following is the data we inserted.
To facilitate testing, we can use
The $type operator is based on the Bson type to retrieve the matching data type in the collection and returns the result.
The types that can be used in MongoDB are shown in the following table:
We used the database name "Runoob", our collection
1. Select a database
Command: Use Datebase_name (database name)Function: If the database is not created directly, if any, switch the databaseThe following results are performed:
Use RunoobSwitched to DB RunoobDbRunoob 2. View all current
Index Base
An index is a structure that sorts the values of one or more columns in a database table, allowing us to query the database more quickly. MongoDB's index is almost identical to the traditional relational database, which includes some
MongoDB implementation file deletion
Do Itoo in the process, in the implementation of the MongoDB file deletion when encountering point problems, Internet search, many online resources, want to find out what they want is not easy, so can only try,
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
dbView the database for the current operation
show dbsShow all databases
show collectionsDisplays all collections under the current database
use database_nameConnect to a database named "database_name" and create if it does not exist
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.