Skip to content

Instantly share code, notes, and snippets.

@jonathanwork
Created January 3, 2017 06:38
Show Gist options
  • Save jonathanwork/426b3aeec886315cfcbbaddb22dee432 to your computer and use it in GitHub Desktop.
Save jonathanwork/426b3aeec886315cfcbbaddb22dee432 to your computer and use it in GitHub Desktop.
getting the records and the content of a collection
//JUST to show record within mongodb
var collections = db.getCollectionNames();
print('Collections inside the db:');
for(var i = 0; i < collections.length; i++){
var name = collections[i];
if(name.substr(0, 6) != 'system')
print(name + ' - ' + db[name].count() + ' records');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment