当前位置:网站首页>MongoDB(三)——CRUD
MongoDB(三)——CRUD
2022-07-06 13:44:00 【全栈程序员站长】
大家好,又见面了,我是全栈君。
MongoDB作为非关系型数据库。还是传统数据库的增删改查有很大的差别的。这里仅仅是将知识点进行了一下提纲挈领,实际用的时候。我们百度一下具体使用方法就可以。
先看大的几个方面:
一。对于里边的插入和删除不再过多赘述。相对来说知识点比較少。
先来看一下更新,经常使用操作还是很实用的,须要我们依据实际情况灵活运用,这里仅仅是提出了知识点,须要百度出样例来学习使用:
2,查询也是一样,看一下知识点的汇总。事实上用几个。还是有规律的。比較easy记录的:
3,看一下固定集合Capped Collection:顾名思义是有着固定大小的集合。其长处是性能比較出色,以LRU(Least Recently Used近期最少使用)规则和插入顺序进行age-out(老化移出)处理。
因为集合空间大小一定,当空间用完。新加入的对象将会代替集合中最旧的对象。永远保持最新的对象。
特点:对固定集合进行插入速度极快;依照插入顺序的查询输出速度极快;能够在插入最新数据时,淘汰最早数据。
使用方法:存储日志信息,最适合只是。缓存一些少量的文档……
创建:db.createCollection(“my_collection”,{capped:true,size:100000})
将普通集合转换为固定集合:db.runCommand({convertTocapped:”test”,size:100000})
4,大文件集合(GridFS):
GridFS是一种在MongoDB中存储大二进制文件的机制。比如:存储巨大的文件,比如视频,高清图片等;GridFS会直接利用已经建立的复制或分片机制,故障恢复和扩展都很easy;能够避免用户上传内容的文件系统出现故障;其不会产生磁盘碎片。
GridFS使用两个表存储数据,默认fs.files:包括元数据对象。fs.chunks包括文件相关信息的二进制块。 通过利用bin文件夹下的mongofiles进行操作,其put(存储),get(取得)和list(列表)三个命令。
很简单的。
好了,简单说了一下MongoDB的增删改查,具体操作实例没有给出,用时查就可以。须要我们知道这些东西,固定集合和大文件集合。是很不错的想法,值得我们特别注意下。
突然想起曾经的看图心想系列,这里好像也能够是的。看着这些图,把其所有讲出来就可以。这样就学的差点儿相同了。
版权声明:本文博主原创文章,博客,未经同意不得转载。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/117045.html原文链接:https://javaforall.cn
边栏推荐
- 袁小林:安全不只是标准,更是沃尔沃不变的信仰和追求
- What about the spectrogram
- One line by line explanation of the source code of anchor free series network yolox (a total of ten articles, you can change the network at will after reading it, if you won't complain to me)
- Vit paper details
- [go][转载]vscode配置完go跑个helloworld例子
- 华为在多个行业同时出击,吓人的技术让欧美企业瑟瑟发抖
- Fastjson parses JSON strings (deserialized to list, map)
- Internet News: Geely officially acquired Meizu; Intensive insulin purchase was fully implemented in 31 provinces
- numpy 下载安装
- JS learning notes OO create suspicious objects
猜你喜欢
数字化转型挂帅复产复工,线上线下全融合重建商业逻辑
中国白酒的5场大战
The golden age of the U.S. technology industry has ended, and there have been constant lamentations about chip sales and 30000 layoffs
Sequoia China, just raised $9billion
ViT论文详解
LeetCode学习记录(从新手村出发之杀不出新手村)----1
Aggregate function with key in spark
关于char[]数组通过scanf赋值使用上的一些问题。。
Uni app app half screen continuous code scanning
红杉中国,刚刚募资90亿美元
随机推荐
Record the process of cleaning up mining viruses
bat脚本学习(一)
The relationship between root and coefficient of quadratic equation with one variable
功能强大的国产Api管理工具
14 years Bachelor degree, transferred to software testing, salary 13.5k
Description of web function test
记一次清理挖矿病毒的过程
对话阿里巴巴副总裁贾扬清:追求大模型,并不是一件坏事
Why does MySQL index fail? When do I use indexes?
Aggregate function with key in spark
抖音將推獨立種草App“可頌”,字節忘不掉小紅書?
uni-app App端半屏连续扫码
The golden age of the U.S. technology industry has ended, and there have been constant lamentations about chip sales and 30000 layoffs
Redistemplate common collection instructions opsforhash (IV)
JPEG2000-Matlab源码实现
Quick access to video links at station B
What is the RDD operator in spark
R language for text mining Part4 text classification
MPLS experiment
50 commonly used numpy function explanations, parameters and usage examples