45

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

Community
  • 1
  • 1
TIMEX
  • 259,804
  • 351
  • 777
  • 1,080

1 Answers1

82

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.

Community
  • 1
  • 1
Cameron
  • 96,106
  • 25
  • 196
  • 225