开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜