MongoDB is a kind of nosql data, how can realize the group function in relational database.
Group
note:currently one must use Map/reduce instead the group () in Sharded MongoDB.
Group returns an array of grouped items. The command is similar to
Steps:One. Installing MongoDBTwo. 2 copies of MongoDB to be installedThree. Modifying a configuration filedbpath=c:\mongofuben\zhu\datalogpath=c:\mongofuben\zhu\logs\mongodb.loglogappend=truejournal=truequiet=
Simple Master-slave replication
Using a master-slave or a master-slave mode, you can separate read and write, improve the availability of the database, but MongoDB's master-slave mode is not able to replace the master node after the failure
1.https://www.mongodb.com/download-center#community2. Installation StepsClick Next to agree to the installation, the following step select CustomCustom CatalogNote: In this step, I put the path written D:\MongoDB installation error, and later
The delete operation uses remove, the data is deleted and the query is similar, accept a parameter, and the query is different, in order to prevent misoperation, the delete operation does not allow the parameter is not passedLike
By default, update updates the first found data, and we do an experiment by inserting 3 C-1 data.Db.test_collection.insert ({c:1})And then we'll find a bit.Db.test_collection.find ({c:1})The result is{"_id": ObjectId ("5b5e3f7da2b4848fd8c49dbf"), "C"
ReasonMongoDB will save the fragmented collection in the Config.collection collection, and if you need to see the Shard key, you need to find it based on that collection. Many other official Shard shortcut commands are also in the Config
Eg: there is a data for name = Lisi,age = 12, now, you want to modify the age of this data = 20The code is as follows:Db.admin.update ({name:'Lisi'},{$set: {age:Ten}})///The first parameter means finding the data, The second parameter indicates that
The following describes how to execute a JS script using MongoDB:
./Mongo 10.1.18.181: 12000/xmail_db test. js
The content of test. JS is as follows:
VaR cursor = dB. getcollectionnames (); // get the collection nameFor (I = 0; I {// Printjson
When mongod.exe is executed to install MongoDB
Unable to locateProgramEnter interlockedcompareexchan.Ge64 on the Dynamic Link Library kernel32.dll
Solution:
If you're seeing that error message, you're attempting to run the Latest Development
1. Clone collection1) clone the remote colletion and run the clonecollection command to copy the remote collection to the local computer.Command Format: DB. runcommand ({clonecollection: "set", from: "original machine", copyindexes: false}),
[From: http://hi.baidu.com/jadmin/blog/item/c734ab589cc52bc69d82043b.html]
I. DB shell database operations
Database
1. Help to view command promptsHelpDB. Help ();DB. yourcoll. Help ();DB. youcoll. Find (). Help ();Rs. Help ();
2. Switch to/create a
Don't use MongoDB=================I've kept quiet for awhile for various political reasons, but I nowfeel a kind of social responsibility to deter people from bankingtheir business on MongoDB.Our team did serious load on MongoDB on a large (10s of
Today, I looked at the MongoDB version and found that it has changed again. The release speed of this version is really fast enough. So I downloaded a new version for installation. The previous version was installed on Windows, for Linux 86, follow
I. Glossary
1.doc ument is the basic unit of data in MongoDB. It is very similar to rows in the relational database management system (but more complex than rows ).
2. collection can be viewed as a table without a schema.
3. A single MongoDB
MongoDB supports multiple languages and is driven by multiple languages.
This blog mainly introduces how to MongoDB storage and read files premise: Download the corresponding driver: Official website download:
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