MongoDB Show all contents from all collections

Reno picture Reno · Jul 27, 2014 · Viewed 338k times · Source

Is it possible to show all collections and its contents in MongoDB?

Is the only way to show one by one?

Answer

sharkySharks picture sharkySharks · Apr 21, 2015

Once you are in terminal/command line, access the database/collection you want to use as follows:

show dbs
use <db name>
show collections

choose your collection and type the following to see all contents of that collection:

db.collectionName.find()

More info here on the MongoDB Quick Reference Guide.