The basic concept of MongoDB Learning notes (ii)

Source: Internet
Author: User
Tags mongodb client mongodb server

The basic concept of MongoDB
1. Documentation
1.1 Definition: Documentation is the core concept of MongoDB. Multiple keys and their associated values are placed in an orderly manner
Together is the document. A document can be understood as the total row of data for a relational database.
1.2 means: {"greeting": "Hello,world"}
1.3 Precautions:
Document contains multiple key/value pairs
The key/value pairs in the document are ordered
A value in a document can not only make a string, but can also be a different data type
The key in the document is a string. The key cannot contain a. The $ special Character _ is also reserved
2. Collection
2.1 Definition: A collection is a set of documents. Can understand a table that is equivalent to a relational database
2.2 Sub-collection: Use "." The characters separate the sub-collection.

3. Database
Multiple documents make up a collection, and multiple collections form a database.

4. Start MongoDB
5.mongodb Shell
5.1 Run MONGO start shell
5.2 MongoDB Client
The real power of the shell is that it is a standalone mongedb client. When it's open,
The shell connects to the MONGODB server's test database and assigns the database connection
To the global variable db. This variable is the main entry point for accessing MongoDB through the shell.

Use database name
DB Print Database name
Db. Collection name return collection
Since you can access the collection in the shell, you can basically perform all of the database
Have done.

The basic concept of MongoDB Learning notes (ii)

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.