【MongoDB】The basic operation of Index in MongoDB
来源:互联网 发布:无机晶体结构数据库 编辑:程序博客网 时间:2024/05/21 17:56
In the past four blogs, we attached importance to the index, including description and comparison with usage of index. Now in this blog, we will mainly focus on the basic operation of index. such query, remove ,repair and so on.
1. View Index
getIndexes could view all the indexes in the collections.
2. Delete index
delete all the indexes: db.test.dropIndexes()
delete one index: db.test.dropIndex({name:1})
use the command to delete index:
db.runCommand({dropIndexes:"test",index:{name:1}})
3. rebuild index
db.test.reIndex() is equalant to db.runCommand({reIndex:'test'})
Attention:This operation need to add the lock into the document, so if the collection was filled with a large number of data, this operation would take much time.
if using repair to fix database, the database will rebuild the index.
0 1
- 【MongoDB】The basic operation of Index in MongoDB
- 【MongoDB】The basic operation of Index in MongoDB
- 【MongoDB】The basic operation of Mongodb, Insert\Query\Delete\Update
- the basic operation of sequence in python
- 【MonogoDB】The high update operation of MongoDB
- 【MongoDB】The high Query operation of MongoDB(一)
- 【MongoDB】The high query operation of MongoDB(二)
- 【MongoDB】The high query operation of MongoDB(三)
- 【MongoDB】The description of procedure in MongoDB
- 【MongoDB】The description of index(一)
- MongoDB Index using when use sorting in the stress testing.
- Basic ReplicaSet Deployment of MongoDB
- The tail of MongoDB
- MongoDB - basic
- 【MongoDB】The Regex Expression query of MongoDB
- 【MongoDB】The Access control of mongodb
- The art in general operation of linux
- The art in general operation of Windows
- 我们对互联网了解多少
- C++引用的实质
- 『产品』有关于 产品设计文档
- Matlab读取CSV文件
- Windows内存管理的方法
- 【MongoDB】The basic operation of Index in MongoDB
- 带头结点的线性链表的实现
- HDU 1847 Good Luck in CET-4 Everybody!(巴什博奕)
- HQL连接查询
- linux下释放内存的cache
- 解决Andriod软键盘出现把原来的布局给顶上去的方法
- 网络给你带了多少便捷
- Codeforces Round #274 (Div. 2) E. Riding in a Lift(DP)
- 双向链表(不带头结点)