当前位置:网站首页>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
边栏推荐
- Redistemplate common collection instructions opsforzset (VI)
- Fzu 1686 dragon mystery repeated coverage
- Vit paper details
- AI 企业多云存储架构实践 | 深势科技分享
- What is the RDD operator in spark
- PostgreSQL modifies the password of the database user
- Reset Mikrotik Routeros using netinstall
- Technology sharing | packet capturing analysis TCP protocol
- Record the process of cleaning up mining viruses
- Why rdd/dataset is needed in spark
猜你喜欢
make menuconfig出现recipe for target ‘menuconfig‘ failed错误
[Yu Yue education] higher mathematics of Nanchang University (2) reference materials
LeetCode学习记录(从新手村出发之杀不出新手村)----1
抖音将推独立种草App“可颂”,字节忘不掉小红书?
Z function (extended KMP)
[Chongqing Guangdong education] Information Literacy of Sichuan Normal University: a new engine for efficiency improvement and lifelong learning reference materials
Yyds dry goods inventory C language recursive implementation of Hanoi Tower
The golden age of the U.S. technology industry has ended, and there have been constant lamentations about chip sales and 30000 layoffs
AI 企业多云存储架构实践 | 深势科技分享
Quick news: the flybook players' conference is held online; Wechat payment launched "education and training service toolbox"
随机推荐
14 years Bachelor degree, transferred to software testing, salary 13.5k
C# 如何在dataGridView里设置两个列comboboxcolumn绑定级联事件的一个二级联动效果
Microsoft technology empowerment position - February course Preview
VIM basic configuration and frequently used commands
Digital transformation takes the lead to resume production and work, and online and offline full integration rebuilds business logic
b站视频链接快速获取
WEB功能测试说明
[Yu Yue education] reference materials for surgical skills teaching in Tongji University
FZU 1686 龙之谜 重复覆盖
Redistemplate common collection instructions opsforlist (III)
Why rdd/dataset is needed in spark
Intelligent online customer service system source code Gofly development log - 2 Develop command line applications
The underlying implementation of string
Numpy download and installation
Four common ways and performance comparison of ArrayList de duplication (jmh performance analysis)
Basic introduction of figure
Fzu 1686 dragon mystery repeated coverage
Web开发小妙招:巧用ThreadLocal规避层层传值
Tiktok will push the independent grass planting app "praiseworthy". Can't bytes forget the little red book?
Comparison between multithreaded CAS and synchronized