getIndexes is not a function on mongo shell
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/