getIndexes is not a function on mongo shell I'm trying to get the index of a collection.

&gt; db.version()
3.2.6

&gt; db.getCollectionNames()
[ "last_aggregated_stat_ids", "mapps", "stats", "system.indexes" ]

&gt; db.mapps.getIndexes()
[
    {
        "v" : 1,
        "key" : {
            "_id" : 1
        },
        "name" : "_id_",
        "ns" : "app_development.mapps"
    }
]

&gt; db.stats.getIndexes()
2016-07-20T16:51:04.601+0200 E QUERY    [thread1] TypeError: db.stats.getIndexes is not a function :
@(shell):1:1


Any ideas of what can happen?
db.stats() is a function call so db.stats is a function reference which has no function called getIndexes().


To get them db.getCollection("stats").getIndexes()

https://docs.mongodb.com/manual/reference/method/db.stats/