开发者

In Mongo, how do I display the indexes of a collection? [duplicate]

开发者 https://www.devze.com 2023-01-31 12:03 出处:网络
This question already has answers here: 开发者_JAVA百科 A list of indices in MongoDB? (7 answers) Closed 8 years ago.
This question already has answers here: 开发者_JAVA百科 A list of indices in MongoDB? (7 answers) Closed 8 years ago.

I just want to display all the indexes in the shell.


If you want raw access to the indexes, you can query the db.system.indexes collection:

> db.system.indexes.find()

To find the indexes for a specific collection, you can do:

> db.collection.getIndexes()

See this question.

0

精彩评论

暂无评论...
验证码 换一张
取 消