1. Course OutlineThis lesson mainly introduces MongoDB background knowledge and MongoDB installation and configuration, so that you have a first understanding of MongoDB.Its basic points of knowledge include:
NoSQL Database Overview
A
Shard and replica set blending:Basic Architecture Diagram:Build detailed configuration:3 x Shard + 3 Replicat set + 3 Configserver + 3 x MONGOs
Shardrsname
Primary
Secondary
Secondary
Port
Bigdata-sh-a
The topology diagram is as follows:You can see that there are four components: MONGOs, config server, shard, replica set.MONGOs, the entrance to the database cluster request, all requests are coordinated through MONGOs, do not need to add a route
This paper mainly records how the MONGO auto-generated Objectid is formed.Take a objectid as an example: 5996B6DE8E4F89047CEF0FECThere are a total of 24 bits of 16 binary numbers, which is 12 bytes.Where the first four bytes represent the current
Update () methodThe update () method is used to update a document that already exists. The syntax format is as follows:Db.collection.update (,,{Upsert: Multi: Writeconcern: })Parameter description:The query:update query condition, similar to that in
Use commandMongoDB creates a database in the same way as use + database name. Use creates a new database and returns the database if it exists.Syntax formatThe basic format of the use statement is as follows:Use database_nameExampleCreate a database
Requirements: We need to create a new two database on a mongodb, each database user name and password is not the same, the rationale is that we directly set the admin, you can control all the database, but used to always feel a variety of problems,
First step to download MongoDBHttp://www.mongodb.org/downloadsStep TwoExtracted to the D:\mongodb\ directory, for the convenience of the command line, you can add the D:\mongodb\bin to the system environment variable path.Step ThreeCreate D:\mongodb\
MongoDB vs. mysql command comparisonThe traditional relational database is usually composed of three hierarchical concepts of database, table, record, and MongoDB is made up of database, collection (collection), Document object composed of three
Not much to say directly on the codeConnection string:{ "AppSettings": { "mongodb" " mongodb://user name: Password @ip Address: port number " }}Main code:1 usingABCDEFG. Config;2 usingMongodb.driver;3 usingSystem;4
In the daily testing process will be found that some of the test data are obtained through the database, commonly used data such as SQL, Oracle, such database jmeter have dedicated plug-in to use JDBC, today to tell you about MongoDB this database
Here's a record of what MongoDB often commandsDatabase relatedCreate a databaseUse database_nameIf the database does not exist, create the database, or switch to the specified database.Delete database : Switch to the database you want to delete,
Previous wordsThis article will detail the data types and $type operators of the MongoDB databaseData typeMongoDB supports the following data typesType Number Memo double1 double-precision floating-point number-This type is used to store
This two weeks to do the site, I took care of the server, database and front end, contact knowledge is very much, in order to prevent later forget, hereby record.This essay mainly records the way MongoDB starts up as a service.1.mongodb Start-up
MongoDB cannot start a workaroundWhen MongoDB suddenly fails to start, the first reaction is to remove Mongod.lock. This file is in the database directory of MongoDB, the default is/data/db. This is the most common problem, due to the fact that
One: Open the installation package bin directoryTwo: Open cmd, switch to Bin directoryThree: Install MongoDB on the service, input mongod in cmd window--installIt's Mongod--install, it's written wrong.Four: Set the configuration file, in the bin
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.