Mongodb 在Mongo中,如何显示集合的索引?

Mongodb 在Mongo中,如何显示集合的索引?,mongodb,indexing,mongodb-indexes,database,Mongodb,Indexing,Mongodb Indexes,Database,我只想显示shell中的所有索引。如果您想原始访问索引,可以查询db.system.index集合: > db.system.indexes.find() 要查找特定集合的索引,可以执行以下操作: > db.collection.getIndexes() 看

我只想显示shell中的所有索引。

如果您想原始访问索引,可以查询
db.system.index
集合:

> db.system.indexes.find()
要查找特定集合的索引,可以执行以下操作:

> db.collection.getIndexes()