listIndexes()

语法

db.collectionspace.collection.listIndexes()

枚举索引,执行此方法会将指定集合下的索引信息全部显示出来。

参数

返回值

返回游标。

错误

错误码

示例

  • 返回集合 bar 下的所有索引信息
  1. > db.foo.bar.listIndexes()