当前位置:网站首页>MongoDB索引
MongoDB索引
2022-07-03 13:42:00 【稻田里展望者】
创建索引 db.comment.createIndex({userid:1})
comment是数据库的名称, userid是数据库的字段
查看索引db.comment.getIndexes()
创建复合索引 db.comment.createIndex({userid:1,nickname:-1})
字段名包括userid 和nickname
移除索引db.comment.dropIndex({userid:1})
移除复杂的索引db.comment.dropIndex("userid_1_nickname_-1")
移除所有的所有db.comment.dropIndexes()
边栏推荐
- Cross linked cyclodextrin metal organic framework loaded methotrexate slow-release particles | metal organic porous material uio-66 loaded with flavonoid glycosides | Qiyue
- Qt学习21 Qt 中的标准对话框(下)
- Vite project commissioning
- FPGA测试方法以Mentor工具为例
- Programmable logic device software testing
- [Jilin University] information sharing of postgraduate entrance examination and re examination
- JS shift operators (< <,> > and > > >)
- Solve MySQL 1045 access denied for user 'root' @ 'localhost' (using password: yes)
- [combinatorics] permutation and combination (two counting principles, examples of set permutation | examples of set permutation and circle permutation)
- QT learning 24 layout manager (III)
猜你喜欢
Uniapp tips - scrolling components
28:第三章:开发通行证服务:11:在配置文件中定义属性,然后在代码中去获取;
Qt学习23 布局管理器(二)
Exercise 8-7 string sorting
Page generation QR code
Use vscode to view hex or UTF-8 codes
天图投资冲刺港股:资产管理规模249亿 投了小红书与奈雪
Exercise 6-6 use a function to output an integer in reverse order
Rasp implementation of PHP
Configure stylelint
随机推荐
UiO-66-COOH装载苯达莫司汀|羟基磷灰石( HA) 包裹MIL-53(Fe)纳米粒子|装载黄芩苷锰基金属有机骨架材料
C library function - qsort()
Qt学习18 登录对话框实例分析
JS Part III
Mysql:insert date:sql error [1292] [22001]: data truncation: incorrect date value:
Uniapp skills - scrolling components -1
MIL-100( Fe) 包裹小分子阿司匹林形成[email protected](Fe)|甘草次酸修饰金属有机框架材料UiO-66-NH2(简称UiO-66-NH2-GA)
Qt学习20 Qt 中的标准对话框(中)
Uniapp tips - scrolling components
JVM object lifecycle
Fabric. JS document
QT learning 25 layout manager (4)
JS new challenges
Qt学习23 布局管理器(二)
Metal organic framework material zif-8 containing curcumin( [email protected] Nanoparticles) | nano metal organic framework carry
叶酸修饰的金属-有机骨架(ZIF-8)载黄芩苷|金属有机骨架复合磁性材料([email protected])|制备路线
JVM class loading
3D vision - 2 Introduction to pose estimation - openpose includes installation, compilation and use (single frame, real-time video)
Multi person collaborative data annotation based on Baidu brain easydata from scratch
How to use lxml to judge whether the website announcement is updated