-
-
Save robertklep/f8f558b0125c950722629d0b76e4dd49 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
function listMongoCollections(db) { | |
return db .listCollections() | |
.toArray() | |
.map(doc => { | |
return db.collection(doc.name).count().then(count => { | |
doc.count = count | |
return doc; | |
}) | |
}) | |
.all(); | |
} |
benjamingr
commented
Jun 6, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment