Created
November 2, 2020 14:56
-
-
Save karan9/5927a708d40f8fc1d2adbf84144674b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var colls = db.getCollectionNames(); | |
var ret = []; | |
colls.forEach(function(coll) { | |
var indexes = db.getCollection(coll).getIndexes(); | |
var len = indexes.length | |
ret.push({ "name": coll, "length": len }); | |
}) | |
printjson(ret) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment