Is there a way to see a list of indices on a collection in mongodb in shell? i read through http://www.mongodb.org/display/DOCS/Indexes but i dont see anything
相关问题
- MongoDB can not create unique sparse index (duplic
- Spring Data MongoDB - lazy access to some fields
- NOT DISTINCT query in mySQL
- Flush single app django 1.9
- Golang mongodb aggregation
相关文章
- mongodb有没有什么办法禁止读取数据的时候进行缓存
- mongodb-aggregate聚合查询分组后如何获得多字段
- mongodb error: how do I make sure that your journa
- How to track MongoDB requests from a console appli
- Use savefig in Python with string and iterative in
- Accessing an array element when returning from a f
- Connection pooling vs persist connection mysqli
- MongoError: cannot infer query fields to set, path
You can also output all your indexes together with their size:
Also check that
db.collectionName.stats()
gives you a lot of interesting information like paddingFactor, size of the collection and number of elements inside of it.If you want to list all indexes:
From the shell:
For shell help you should try:
Taking this one step further, if you'd like to find all indexes on all collections, this script (modified from Juan Carlos Farah's script here) gives you some useful output, including a JSON printout of the index details:
Make sure you use your collection:
http://docs.mongodb.org/manual/administration/indexes/#information-about-indexes
And if you want to get list of all indexes in your database: