Created
June 29, 2020 22:11
-
-
Save AlexNolasco/0051b6c1ce3e1eb499c9977c076f764f to your computer and use it in GitHub Desktop.
MongoDB Get Collection Record Numbers
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
db.getCollectionNames().forEach(function(collection) { | |
records = db[collection].count() | |
if (records > 0) { | |
print( collection + ": " + records); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment