Created
January 3, 2017 05:24
-
-
Save jonathanwork/7ba75b055fc5e25efab209b6ad46330c to your computer and use it in GitHub Desktop.
this will look into all your collections within mongoDB
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
var collections = db.getCollectionNames(); | |
for(var i = 0; i< collections.length; i++){ | |
print('Collection: ' + collections[i]); // print the name of each collection | |
db.getCollection(collections[i]).find().forEach(printjson); //and then print the json of each of its elements | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment