Last active
August 31, 2017 21:58
-
-
Save townie/402bc44f63994f3cc1e1a8e9704ad5ba to your computer and use it in GitHub Desktop.
Get all of the collections and records out of a database
This file contains hidden or 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
// mongo 127.0.0.1/MMApp collect.js >> collects.txt | |
var collects= db.getCollectionNames(); | |
collects.forEach(function(name, i) { | |
var c = db[name].find(); | |
while(c.hasNext()) { | |
printjson(c.next()) | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment