OverviewMongoDB is a very popular non-relational database, as the first article in the introductory series, this article mainly introduces the basic conceptual knowledge of mongdb including naming rules, data types, functions and
The basic concept of MongoDB1. Documentation1.1 Definition: Documentation is the core concept of MongoDB. Multiple keys and their associated values are placed in an orderly mannerTogether is the document. A document can be understood as the total
Turn from: Easy hundred tutorialsThe data in MongoDB has a flexible pattern. The documents are in the same collection, but they do not need to have the same field or structure collection, and the public fields in the collection document can contain
1. Multi-core system resource allocation2017-10-13t17:57:02.650+0800 I CONTROL [initandlisten] * * Warning:you is running on a NUMA machine.2017-10-13t17:57:02.6 50+0800 I CONTROL [initandlisten] * * We suggest launching mongod like this to avoid
In MongoDB (version 3.2.9), the distribution of data refers to splitting the collection data into chunks (chunk) and distributing them on different shards (shard). There are 2 main ways to distribute data: Balanced distribution based on the number
MySQL has always been the most cost-effective relational database modelMongoDB brings a NoSQL experience outside the relational database.Let's look at a simple example of how we will create a data structure for MySQL (or any relational database) and
1. Basic Enquiry:Constructs the query data.> Db.test.findOne (){"_id": ObjectId ("4fd58ecbb9ac507e96276f1a"),"Name": "Stephen","Age": 35,"Genda": "Male","Email": "[email protected]"}--Multi-criteria query. The following example is equivalent to the
Objective: To achieve index creation, query, delete, Explan management and other operating environment:> Db.version () 3.4.7 index creation meets the basic needs: 1; Index increases query speed by 2; In MongoDB, indexes can be created in
MongoDB Analyzer:To detect if the MongoDB parser is open:Db.getprofilinglevel ()
0 indicates no open
1 means open, and if the query execution time exceeds the maximum query execution time for the second parameter in milliseconds (ms),
System environment: Windows Ten, python3.x1. Installing MongoDBMongoDB Download Website: https://www.mongodb.com/download-center?jmp=nav#communityInstallation Tutorial Online A lot, you can self-Baidu (http://www.cnblogs.com/lzrabbit/p/3682510.html),
Role Specific Description:READ: Allows the user to read the specified databaseReadWrite: Allows the user to read and write to the specified databaseDbAdmin: Allows the user to perform administrative functions in the specified database, such as index
Backup
Grammar
mongodump -h dbhost -d dbname -o dbdirectory
-H: Server address, or port number can be specified
-D: The name of the database that needs to be backed up
-O: The data storage location of the backup, which contains
Create a collection to hold _idDb.createcollection ("counters")Add fields that require self-increment{ "_id": "ProductID", "Sequence_value": 0}Then add the self-increment JS method in the MongoDB library Getnextsequencevaluefunction (sequencename)
Toss two days, the former leader left the mess, the day before yesterday suddenly hung up, the whole company I will Linux, Grandma's, Long story.Below is a record of how to install MongoDB, the front is copied from the Novice tutorial1. Download -
Practices and precautions for upgrading and downgrading primary and secondary nodes in the mongodb replica setConsiderations and practices for upgrading and downgrading primary and secondary nodes in the mongodb replica set
This article is based
Mongodb deduplication, aggregation, query explanation, mongodb Aggregation
I recently learned about mongodb and some people understand it:
1. deduplication
Repeated template. getCollection (collectionName). distinct () returns the list set,
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