In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
What is the concept of MongoDB? aiming at this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.
Database
Multiple databases can be set up in a mongodb. The default database for MongoDB is "db", which is stored in the data directory. A single instance of MongoDB can hold multiple independent databases, each with its own collection and permissions, and different databases are placed in different files.
The database is also identified by name. The database name can be any UTF-8 string that meets the following conditions.
Cannot be an empty string (").
Must not contain''(spaces),., $, /,\ and\ 0 (empty characters).
It should be all lowercase.
Up to 64 bytes.
Document
A document is a set of key-value pairs (that is, BSON). MongoDB documents do not need to set the same fields, and the same fields do not need the same data type, which is very different from relational databases, which is also a very prominent feature of MongoDB.
Document key naming convention:
The key cannot contain\ 0 (empty characters). This character is used to indicate the end of the key.
. And $have special meaning and can only be used in specific circumstances.
The keys that begin with the underscore "_" are reserved (not strictly required).
Set
Collections are MongoDB document groups, similar to tables in RDBMS (Relational Database Management system: Relational Database Management System). The collection exists in the database, and the collection has no fixed structure, which means that you can insert different formats and types of data into the collection, but usually the data we insert into the collection will have certain relevance.
Legal collection name
The collection name cannot be an empty string''.
The collection name cannot contain the\ 0 character (empty character), which represents the end of the collection name.
The collection name cannot be "system." At the beginning, this is the prefix reserved for the system collection.
User-created collection names cannot contain reserved characters. Some drivers do support inclusion in the collection name because some system-generated collections contain this character. Never include $in your name unless you want to access a collection created by this system.
Data type
String string. Data types commonly used to store data. In MongoDB, a string encoded by UTF-8 is legal.
Integer integer value. Used to store numeric values. According to the server you use, it can be divided into 32-bit or 64-bit.
Boolean Boolean value. Used to store Boolean values (true / false).
Double double precision floating point value. Used to store floating-point values.
Min/Max keys compares a value to the lowest and highest values of the BSON (binary JSON) element.
Array is used to store an array or list or multiple values as a key.
Timestamp timestamp. Record when the document was modified or added.
Object is used to embed documents.
Null is used to create null values.
Symbol symbol. This data type is basically equivalent to a string type, but it is generally used in languages with special symbolic types.
Date date time. Stores the current date or time in UNIX time format. You can specify your own date and time: create a Date object and pass in the year, month and day information.
Object ID object ID. The ID used to create the document.
Binary Data binary data. Used to store binary data.
Code code type. Used to store JavaScript code in a document.
Regular expression regular expression type. Used to store regular expressions.
The answer to the question about the concept of MongoDB is shared here. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.