Skip to content

Instantly share code, notes, and snippets.

@andy722
Created October 28, 2020 11:30
Show Gist options
  • Save andy722/accf0dfa91bb4b8c7d0e0069bafa9f15 to your computer and use it in GitHub Desktop.
Save andy722/accf0dfa91bb4b8c7d0e0069bafa9f15 to your computer and use it in GitHub Desktop.
MongoDB: list collection files
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