What is MongoDB?
MongoDB is written by C + + language and is an open source database system based on distributed file storage.
In the case of high load, adding more nodes can guarantee the performance of the server.
MongoDB is designed to provide
Principle:
1. First query the total number of records in the table
2. Random get Offset is 0~ total record number-1
3. Skip offset at query, and get 1 records
Because I test the environment PHP has upgraded to more than 7.0, MongoDB extended Use
Prepare test data db.user.drop ();
for (var i=10 i25 users, group by class, showing the name and sex of the user in each class, and counting the number of people in each group Db.user.group ({key: {"Class": true}, initial: {"person": []}
,
NoSQL is very hot, mongodb as a good distributed file storage database, also received a lot of attention, Http://weibo.com/k/mongodb Sina Weibo in the daily now about more than 20 information.
Official website: http://www.mongodb.org/
Download:
Last week in Ruby-china posted "MongoDB those pits", reflected quite enthusiastic, many reply very insightful, one of the children's shoes in-depth mention of the MongoDB indexing method, which led me to a more in-depth understanding of the MongoDB
1. First download the MongoDB installation package at the official website:
Http://www.mongodb.org/downloads
Here we download the zip format of the download, the other did not install, will not, will not say.
2. After extracting the file:
3.
1. Copy MongoDB to the specified server
To the MongoDB official website http://www.mongodb.org/downloads download MongoDB, unzip and test the directory to the server that needs to be installed, and then configure. For example:
Copy Code code
Starting from this article, we mainly discuss the deployment technology of MongoDB.
We know that SQL Server can do read-write separation, dual-machine hot backup and cluster deployment, of course, MongoDB can do, in practice, we do not want the
Examples of cursors used in MongoDB are as follows:Suppose you do the following:
Db. Xxx.remove ();
Db. Xxx.insert ({"Name": "BuleRiver1", "Age":});
Db. Xxx.insert ({"Name": "BuleRiver2", "Age":});
Db. Xxx.insert ({"Name": "BuleRiver3", "Age": 2
In MongoDB, the Db.collection.remove () method is used to delete documents from the document. You can delete all documents from a collection, delete all documents that match one condition, or restrict actions to delete only one document.
Delete all
The example of this article describes the simple operation of Php MongoDB method. Share to everyone for your reference, specific as follows:
PHP operation MongoDB First download the MongoDB expansion pack from the Internet,
The Java data types for MongoDB are:
Object IDs Auto IDRegular Expressions Regular Expression Search recordsDates/times timeDatabase References Data InfrastructureBinary Data Binary StreamTimestamp Data time StampCode Data CodesEmbedded Documents
The example of this paper describes the method of Pymongo to control the addition of digital fields in MongoDB. Share to everyone for your reference. The specific analysis is as follows:
This is very practical, for example, we need to give the
As a beginner, I also encountered a lot of problems when doing this example, in the view of some Daniel's solution, finally achieved this simple effect, I will share this source code, and the problems I encounteredThis is an example of the NODEJS
Nosql is not the only SQL, which is a non-relational database, with high availability, high performance and extensibility features, is distributed, open source, level extensible, originally for large-scale Web services, its own characteristics: mode
The following is the way to download the installation package decompression installation:Https://www.mongodb.com/download-center#community, can also self-Baidu
First, unzip the downloaded installation package to the path where you want to
mongodb permissions mechanism before you start the permission mechanism, first Add admin account in MONGODB:1. Create an Account
To reinstall a mongodb, add a --auth parameter when installing:
First remove the installed from the
Use aggregation, db. Collection name. Aggregate... Rather than find.Pipelines are typically used in UNIX and Linux to use the output of the current command as a parameter to the next command.MongoDB's aggregation pipeline passes the MongoDB document
MongoDB is a document-oriented (document-oriented) database, not a relational database. Document-oriented databases do not have a "line" concept compared to a relational database, instead of a "document" model① in the official website
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