查询集合数量
db.getCollectionNames().filter(function(c) { return !c.startsWith("system."); }).length
查询每个集合的索引数量
db.getCollectionNames().forEach(function(col) { print("Indexes for " + col + ": " + db.getCollection(col).getIndexes().length); })
查询集合数量
db.getCollectionNames().filter(function(c) { return !c.startsWith("system."); }).length
查询每个集合的索引数量
db.getCollectionNames().forEach(function(col) { print("Indexes for " + col + ": " + db.getCollection(col).getIndexes().length); })