Getting to Know MongoDB

Document is the basic unit of MongoDB. Conceptually, a document is equivalent to a row of a relational database; a collection is equivalent to a table of a relational database; a MongoDB instance can have multiple independent databases, and each database can have its own collection.
1. Documents:
Each document has a special key "_id", which is unique in the collection to which the document belongs. The key-value pair of the document is an ordered set; the key of the document is composed of business UTF-8 characters except '\0', of which '.' and '$' have special meanings and can only be used in specific environments use.
2. Collection A
collection is a group of documents, and a sub-collection can also be defined using the '.' syntax; the collection is named with UTF-8 characters,
a. It cannot be named with an empty string;
b. It cannot contain '\0'
c, '$' is a reserved character; because some system-generated sets are named with '$'.
d. Cannot start with 'system.'. It is because the system collection name starts with 'system.'
3. Database
Multiple collections form a database, the
database name cannot be an empty string, and cannot contain '/ \ . " * < > : | ? $ space\0' characters, basically only Letters and numbers in ASCII, database name is case-sensitive, up to 64 bytes.
Reserved database names are: admin, local, config

---------------------- ---------------------------------------------
If there are other questions If there are errors in the text, please point them out to me in time, so that
I can correct them in time and let us make progress together.
Email: [email protected]
qq: 1035862795 Stepping
stone: Code composes life

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326489977&siteId=291194637