当前位置:网站首页>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()
边栏推荐
- [clean up the extraordinary image of Disk C]
- Rasp implementation of PHP
- Why are grass-roots colleges and universities with "soil and poverty" called "Northeast small Tsinghua"?
- JS download files through URL links
- Redis:字符串类型数据的操作命令
- 7-7 12-24 hour system
- How to promote the progress of project collaboration | community essay solicitation
- Exercise 9-3 plane vector addition
- JS continues to explore...
- Onmenusharetimeline custom shared content is invalid, and the title and icon are not displayed
猜你喜欢
JS Part III
Redis: commandes d'action pour les données de type chaîne
Multi person collaborative data annotation based on Baidu brain easydata from scratch
Exercise 10-2 recursive factorial sum
Redis: redis data structure and key operation commands
QT learning 23 layout manager (II)
QT learning 24 layout manager (III)
Qt学习17 对话框及其类型
7-9 find a small ball with a balance
Current situation, analysis and prediction of information and innovation industry
随机推荐
Interface for querying IP home
jvm-类加载
Generate directories from web content
Qt学习21 Qt 中的标准对话框(下)
Qt学习23 布局管理器(二)
金属有机骨架MOFs装载非甾体类抗炎药物|ZIF-8包裹普鲁士蓝负载槲皮素(制备方法)
Rasp implementation of PHP
Multi person collaborative data annotation based on Baidu brain easydata from scratch
Common mixins
牛客网:过河卒
【吉林大学】考研初试复试资料分享
28: Chapter 3: develop Passport Service: 11: define attributes in the configuration file, and then obtain them in the code;
Uniapp skills - scrolling components -1
Global event bus
Uio-66-cooh loaded bendamostine | hydroxyapatite (HA) coated MIL-53 (FE) nanoparticles | baicalin loaded manganese based metal organic skeleton material
JS matrix zero
Redis:Redis的数据结构、key的操作命令
消息订阅与发布
Failure of vector insertion element iterator in STL
Selenium browser (1)