Listing collections in a MongoDB database

Listing and showing collections in a MongoDB database

A collection in MongoDB is a group of documents (JSON objects). A collection represent a table in an RDBMS except that it's schema-less which means that every document inside of a colelction can have different strcuture and different field types.

To list MongoDB collections we'll use the "show collections" command.

> use yamicode
switched to db yamicode
> show collections
col1
col2
...