Skip to content

Instantly share code, notes, and snippets.

@msplival
Created June 13, 2017 07:20
Show Gist options
  • Save msplival/b9b5c8fb2ff67e2e9a463fc0bb0fce3a to your computer and use it in GitHub Desktop.
Save msplival/b9b5c8fb2ff67e2e9a463fc0bb0fce3a to your computer and use it in GitHub Desktop.
List MongoDB collection filenames
function getcolfilename(colName) { return db.getCollection(colName).stats()["wiredTiger"]["uri"] }
db.getCollectionNames().forEach(function(n){ print(getcolfilename(n) + " " + n ) } )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment