Return a List of All Indexes in MongoDB

List all Indexes on a Collection

db.people.getIndexes()

List all Indexes for a Database

db.getCollectionNames().forEach(function(collection) {
   indexes = db[collection].getIndexes();
   print("Indexes for " + collection + ":");
   printjson(indexes);
});

References
https://docs.mongodb.com/manual/tutorial/manage-indexes/