A list of indices in MongoDB?

前端 未结 6 946
离开以前
离开以前 2020-12-07 23:57

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

6条回答
  •  离开以前
    2020-12-08 00:39

    You can also output all your indexes together with their size:

    db.collectionName.stats().indexSizes
    

    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.

提交回复
热议问题