Created
October 28, 2020 11:30
-
-
Save andy722/accf0dfa91bb4b8c7d0e0069bafa9f15 to your computer and use it in GitHub Desktop.
MongoDB: list collection files
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.adminCommand( { listDatabases: 1 } ).databases.forEach(function (otherDb) { | |
var siblingDb = db.getSiblingDB(otherDb.name); | |
siblingDb.getCollectionInfos().forEach(function (coll) { | |
print(otherDb.name + '.' + coll.name + '\t->\t' + siblingDb.getCollection(coll.name).stats().wiredTiger.uri) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment