当前位置:网站首页>Mongodb (III) - CRUD
Mongodb (III) - CRUD
2022-07-06 21:58:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm the king of the whole stack .
MongoDB As a non relational database . There is a big difference between the addition, deletion and modification of the traditional database . Here is just a summary of the knowledge points , In practice . We Baidu specific use method can .
Let's look at the major aspects first :
One . I won't go into too much detail about the insertion and deletion inside . Relatively speaking, there are few knowledge points .
Let's take a look at the update , It's very practical to use the operation often , We need to use it flexibly according to the actual situation , Here is just a knowledge point , Baidu needs to give examples to learn and use :
2, It's the same with queries , Take a look at the summary of knowledge points . In fact, use a few . There are still rules . Compare easy Records of the :
3, Look at the fixed set Capped Collection: As the name suggests, it is a set with a fixed size . Its advantage is its excellent performance , With LRU(Least Recently Used Use at least in the near future ) Rules and insertion order age-out( To remove from ) Handle .
Because the size of the collection space must be , When space runs out . The newly added object will replace the oldest object in the collection . Always keep the latest object .
characteristic : Inserting a fixed set is extremely fast ; The query output speed according to the insertion order is extremely fast ; When inserting the latest data , Eliminate the first data .
Usage method : Store log information , Most suitable for just . Cache a few documents ……
establish :db.createCollection(“my_collection”,{capped:true,size:100000})
Convert a normal set to a fixed set :db.runCommand({convertTocapped:”test”,size:100000})
4, Large file set (GridFS):
GridFS It's a kind of MongoDB The mechanism of storing large binary files in . such as : Store huge files , Like video , High definition pictures, etc ;GridFS Will directly use the established replication or fragmentation mechanism , Fault recovery and expansion are very easy; The file system that can prevent users from uploading content fails ; It does not generate disk fragments .
GridFS Use two tables to store data , Default fs.files: Including metadata objects .fs.chunks A binary block that contains information about a file . By using bin Under folder mongofiles To operate , Its put( Storage ),get( obtain ) and list( list ) Three commands .
Very simple. .
Okay , Just to put it briefly MongoDB Addition, deletion and modification of , Specific operation examples are not given , Just check it with time . We need to know these things , Fixed set and large file set . Is a very good idea , It deserves our special attention .
Suddenly I think of the past series of looking at pictures and thinking , It seems that it can be here . Look at these pictures , Just tell it all . In this way, you almost learn the same .
Copyright notice : This article is the original article of the blogger , Blog , Do not reprint without permission .
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/117045.html Link to the original text :https://javaforall.cn
边栏推荐
- Happy sound 2[sing.2]
- Reset Mikrotik Routeros using netinstall
- Sql: stored procedures and triggers - Notes
- Shell product written examination related
- guava:Collections. The collection created by unmodifiablexxx is not immutable
- Intelligent online customer service system source code Gofly development log - 2 Develop command line applications
- NPM run dev start project error document is not defined
- Realization of epoll reactor model
- [asp.net core] set the format of Web API response data -- formatfilter feature
- Univariate cubic equation - relationship between root and coefficient
猜你喜欢

【MySQL】Online DDL详解

美国科技行业结束黄金时代,芯片求售、裁员3万等哀声不断

GPS from getting started to giving up (16), satellite clock error and satellite ephemeris error
![Leetcode topic [array] -118 Yang Hui triangle](/img/77/d8a7085968cc443260b4c0910bd04b.jpg)
Leetcode topic [array] -118 Yang Hui triangle

C how to set two columns comboboxcolumn in DataGridView to bind a secondary linkage effect of cascading events

Shake Sound poussera l'application indépendante de plantation d'herbe "louable", les octets ne peuvent pas oublier le petit livre rouge?

Checkpoint of RDD in spark

JS method to stop foreach

C# 如何在dataGridView里设置两个列comboboxcolumn绑定级联事件的一个二级联动效果

Digital transformation takes the lead to resume production and work, and online and offline full integration rebuilds business logic
随机推荐
基于InsightFace的高精度人脸识别,可直接对标虹软
Kohana database
GPS从入门到放弃(十二)、 多普勒定速
红杉中国,刚刚募资90亿美元
Mysql相关术语
The relationship between root and coefficient of quadratic equation with one variable
Explain ESM module and commonjs module in simple terms
ROS error: could not find a package configuration file provided by "move_base“
Redistemplate common collection instructions opsforzset (VI)
Why rdd/dataset is needed in spark
NPM run dev start project error document is not defined
搜素专题(DFS )
Unity3D学习笔记6——GPU实例化(1)
[Yu Yue education] higher mathematics of Nanchang University (2) reference materials
Microsoft technology empowerment position - February course Preview
GPS从入门到放弃(二十)、天线偏移
[Yu Yue education] reference materials for surgical skills teaching in Tongji University
Codeforces Round #274 (Div. 2) –A Expression
Is it important to build the SEO foundation of the new website
Tips for web development: skillfully use ThreadLocal to avoid layer by layer value transmission