当前位置:网站首页>Introduction to mongodb
Introduction to mongodb
2022-07-03 03:23:00 【Johnny. G】
MongoDB brief introduction
1、MongoDB summary
from C++ Language writing , Open source and based on distributed file storage ; Under high load , Ensure server performance by adding more nodes ; For the purpose of WEB Applications provide scalable, high-performance data storage solutions ; Store data as a document , Data structure consists of key value pairs (key / value);
Its documents are similar JSON object , Field values can contain other documents 、 Arrays and document arrays .
2、MongoDB characteristic
• Scalable 、 High performance next generation database ;
• Easy to deploy 、 Easy to use 、 It's convenient to store data ;
• Document oriented (json Format ) Storage , Easy to read 、 Efficient ;
• Model freedom , Support dynamic query 、 Full index , Modeless ;
• Efficient data storage , Increased efficiency ;
• Support for replication and recovery ;
• To support cloud level scalability , Support horizontal database clustering , Additional servers can be added dynamically ;
3、MongoDB The elements of
MongoDB By Library (database)、 aggregate (collection)、 Document object (documen) Three levels make up , Similar to the traditional relational database, the database (database)、 surface (table)、 Record (record) Three levels of composition . among , The document is similar to json The key/value pair , for example :{“name”:“tom”,“age”:23}, A collection is a collection of documents , A library is a collection of sets .
4、MongoDB Support language

5、MongoDB Of “ObjectId”
Different machines can easily generate it with the same method that is globally unique .ObjectId Use 12 Byte storage space , The generation method is as follows :
example :
4e931cb61e19edcd8800017f
Time stamp machine ID PID Counter
notes :
• Timestamp can guarantee the uniqueness of seconds ;
• machine ID It can ensure that the distributed design is considered , Avoid clock synchronization ;
• PID It can ensure that the same server runs multiple mongod Uniqueness when instance ;
• The counter can guarantee the uniqueness in the same second ;
6、MongoDB data type
| data type | give an example |
|---|---|
| Null value | null |
| Boolean | ture & false |
| Integers | 123 |
| floating-point | 12.3 |
| character string | “hello world” |
| object ID | use new ObjectId() To claim |
| date | use new Date() To declare the timestamp |
| Array | [“apple”,”blanan”,”pear”] |
| Embedded documents | {“username” : “jone”, “age”: 13, “contact” : {“home”:”123”,”moblie”:”456”}} |
| RegExp( Regular expressions ) | /[a-z]/ |
7、MongoDB And TRDB Comparison of basic concepts of database
| MongoDB | TRDB | Than a say bright |
|---|---|---|
| library DB | library DB | Have the concept of Library , You need to use the command to create the library name . For example, two database names are established according to different projects , One for test library , Used for testing , One for goodsdb library , Used for formal business data storage and operation |
| aggregate | surface | A set corresponds to a table . MongoDB There is no need to define the set structure in advance , TRDB The table structure must be forcibly defined in advance |
| file | That's ok | Every document has a special _id,_id The value is unique in the collection to which the document belongs , Default by MongoDB Self maintenance , Of course, it can also be specified by the programmer . One “ file ” similar TRDB Of —“ That's ok ” Record ,“ file ” Avoid the relationship between different sets ( Join ) ,; And then “ That's ok ” On the basis of TRDB Emphasize the relationship |
| Key value pair | field value | MongoDB“ file ” One of the “ Key value pair ” similar TRDB One of them “ field value ”, however “ file ” Inside “ Key value pair ” More complex data structures can be embedded |
边栏推荐
- VS克隆时显示403错误
- Bigvision code
- MySQL practice 45 lecture [row lock]
- Limit of one question per day
- Hi3536c v100r001c02spc040 cross compiler installation
- labelimg生成的xml文件转换为voc格式
- Basic information of Promethus (I)
- 敏捷认证(Professional Scrum Master)模拟练习题-2
- C programming learning notes [edited by Mr. Tan Haoqiang] (Chapter III sequence programming) 05 data input and output
- 二进制流转换成字节数组
猜你喜欢

Vs 2019 configuration du moteur de génération de tensorrt

Limit of one question per day

MongoDB安装 & 部署
![[error record] the parameter 'can't have a value of' null 'because of its type, but the im](/img/1c/46d951e2d0193999f35f14d18a2de0.jpg)
[error record] the parameter 'can't have a value of' null 'because of its type, but the im

Pytoch lightweight visualization tool wandb (local)

Hi3536C V100R001C02SPC040 交叉编译器安装

MongoDB简介

Bid farewell to artificial mental retardation: Mengzi open source project team received RMB 100 million financing to help NLP develop

Vs 2019 configure tensorrt to generate engine

VS 2019安装及配置opencv
随机推荐
机械臂速成小指南(八):运动学建模(标准DH法)
C programming learning notes [edited by Mr. Tan Haoqiang] (Chapter III sequence programming) 03 operators and expressions
[combinatorics] Application of exponential generating function (multiple set arrangement problem | different balls in different boxes | derivation of exponential generating function of odd / even sequ
What happens between entering the URL and displaying the page?
Destroy the session and empty the specified attributes
VS 2019 配置tensorRT生成engine
Pytoch configuration
[combinatorics] basic counting principle (addition principle | multiplication principle)
Find the storage address of the elements in the two-dimensional array
New programmers use the isXXX form to define Boolean types in the morning, and are discouraged in the afternoon?
@Accessors注解作用指定前缀遵守驼峰命名
C#通用接口调用
Idea format code idea set shortcut key format code
labelimg生成的xml文件转换为voc格式
监听对象中值变化及访问
L'index des paramètres d'erreur est sorti de la plage pour les requêtes floues (1 > Nombre de paramètres, qui est 0)
softmax的近似之NCE详解
Docker install redis
VS克隆时显示403错误
Model transformation onnx2engine