A list of indices in MongoDB?

Timmy picture Timmy · May 7, 2010 · Viewed 31.8k times · Source

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

Answer

mdirolf picture mdirolf · May 8, 2010

From the shell:

db.test.getIndexes()

For shell help you should try:

help;
db.help();
db.test.help();