First enable the MongoDB HttpinterfaceModify Mongodb.confComment this row
The code is as follows
Copy Code
#nohttpinterface = True
Httpinterface Port is MongoDB Port +1000If the default port for MongoDB is 27018
Create a directory as follows
Extract the MongoDB compressed package into the MongoDB directory
Mongodata Create the Data directory to store the information; Create the log directory to store the directory
CMD input command:
MongoDB is a database based on distributed file storage. Written by the C + + language. Designed to provide scalable, high-performance data storage solutions for WEB applications.
MongoDB is a product between relational database and non relational
0x00 MongoDB Permissions Introduction
1.MongoDB installation does not add any parameters, the default is not permission to authenticate, the user can log on to the database any operation and remote access to the database, you need to start with the-
The indexes in MongoDB are similar to relational databases, all in order to improve the efficiency of query and sorting, and the principle of implementation is basically consistent. Because the key (field) in the collection can be a normal data type,
MongoDB is currently the hottest NoSQL document database, it provides some good features: such as automatic failover mechanism, automatic sharding, modeless schemaless, most of the performance is also good. But in the deep use of mint in the process
By default, shutting down Shell,mongodb stops running.
If you want to run in the background, you can start by simply adding the--fork function.
You can add--logappend after the log path to prevent the log from being deleted.
Copy Code code
MongoDB is an open source NoSQL database that is primarily used in large data situations and is considered the Node.js's golden partner, and because it uses the binary JSON format, it has no affinity to JavaScript with any language. The specific
MongoDB is a document-type database, one of the most important members of the NoSQL family, and the following code encapsulates the basic operations of MongoDB.
Mongodbconfig.java
Package Com.posoftframework.mongodb;
Import
1, configuration: Mongod--dbpath=d:\mongodb\data
Mongo
2, the basic additions and deletions to check and change
Find () Update ()--Overall update, local update.
Modifier: $inc db.person.update ({"Age": 23},{$inc: {"Salary": 1000}})
The first
Download path: Http://downloads.mongodb.org/win32/mongodb-win32-i386-1.7.0.zip
Put a DB folder I was put to D disk, path: Ddb
Extract Mongodb-win32-i386-1.7.0.zip rename it to MongoDB put it in D disk
Open cmd input: d:mongodbbinmongod.exe–dbpath=
Look for a long time query Objectid method is wrong, with Mongovue can query out, but is using Java do not know how to query
1.mongovue Query mode:
Copy Code code as follows:
{"_id": ObjectId ("5326bfc0e6f780b21635248f")}
2. In the
Start MongoDB: sudo service mongodb start ,mongo
After testing, the key can be quoted or not added, but the value is generally quoted, except for the value type
MongoDB is case-sensitive, and naming is usually based on the camel-named
1. Download MongoDB, the version downloaded here is: Mongodb-linux-i686-1.8.1.tgz.tar.Http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.8.1.tgz2. Unzip the file into a directory and rename it:
[Root@localhost src]# tar-xzvf mongodb-linux-
General backup strategy for MongoDB1 Cold Backup--Copy database files2 Mongodump/mongorestoreBesides Mongodump/mongorestore, there's a couple of mongoexport/mongoimport.Difference:Mongoexport/mongoimport Import/Export is in JSON format, and
MongoDB has been used for a long time, and MongoDB-based data storage has not been used to access permissions (MongoDB defaults to unrestricted access restrictions), today took a little time to study, the research results are as follows:Note: The
How is the master node elected for replica set failover? Can I manually interfere with the Dismounting of a master node.Officially, the number of replica sets is preferably an odd number. Why?How is the mongodb replica set synchronized? What happens
View all data tables> Use ChatRoomSwitched to db ChatRoom> Show collectionsAccountChatSystem. indexesSystem. users Create a data table> Db. createCollection ("Account "){"OK": 1} > Db. createCollection ("Test", {capped: true, size: 10000}) {"OK": 1}{
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