当前位置:网站首页>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
边栏推荐
- Run the deep network on PI and Jetson nano, and the program is killed
- Shell product written examination related
- Some problems about the use of char[] array assignment through scanf..
- Write a rotation verification code annotation gadget with aardio
- Leetcode topic [array] -118 Yang Hui triangle
- GPS from getting started to giving up (16), satellite clock error and satellite ephemeris error
- Make menuconfig has a recipe for target 'menuconfig' failed error
- 11、 Service introduction and port
- Uni app app half screen continuous code scanning
- Hill | insert sort
猜你喜欢
Tiktok will push the independent grass planting app "praiseworthy". Can't bytes forget the little red book?
LeetCode:1189. The maximum number of "balloons" -- simple
GPS从入门到放弃(十三)、接收机自主完好性监测(RAIM)
华为在多个行业同时出击,吓人的技术让欧美企业瑟瑟发抖
Persistence / caching of RDD in spark
Earned value management EVM detailed explanation and application, example explanation
JPEG2000 matlab source code implementation
Uni app app half screen continuous code scanning
uni-app App端半屏连续扫码
Reptile practice (V): climbing watercress top250
随机推荐
Oracle Performance Analysis 3: introduction to tkprof
设置状态栏样式Demo
Five wars of Chinese Baijiu
[Chongqing Guangdong education] Tianjin urban construction university concrete structure design principle a reference
Search map website [quadratic] [for search map, search fan, search book]
Make menuconfig has a recipe for target 'menuconfig' failed error
功能强大的国产Api管理工具
Realization of epoll reactor model
Shake Sound poussera l'application indépendante de plantation d'herbe "louable", les octets ne peuvent pas oublier le petit livre rouge?
Hill | insert sort
VIP case introduction and in-depth analysis of brokerage XX system node exceptions
c语言char, wchar_t, char16_t, char32_t和字符集的关系
Enhance network security of kubernetes with cilium
20 large visual screens that are highly praised by the boss, with source code templates!
麦趣尔砸了小众奶招牌
Save and retrieve strings
Vit paper details
抖音将推独立种草App“可颂”,字节忘不掉小红书?
It's not my boast. You haven't used this fairy idea plug-in!
在Pi和Jetson nano上运行深度网络,程序被Killed