From charlesreid1

Revision as of 08:08, 31 January 2018 by Admin (talk | contribs) (Created page with "=Getting Info About Databases= ==Mongo shell== Start the mongo shell: <pre> $ mongo > </pre> To list all available databases, use any of these commands: <pre> > db.adminC...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Getting Info About Databases

Mongo shell

Start the mongo shell:

$ mongo
>

To list all available databases, use any of these commands:

> db.adminCommand('listDatabases')
> db.getMongo().getDBNames()
> show databases
> show dbs

Show all tables and collections in a database:

> use test_db
> show tables
> show collections
> db.getCollectionNames()