Why mongo shell is "connecting to: test"?

April 16, 2015 18.4k views

Can anyone explain why when I run the mongo shell it is “connecting to: test”?

1 Answer

By default, just running mongo will enter the shell and connect to the “test” database. Typing db into the shell should return test

> db

You can switch databases, with the use command:

> use admin
switched to db admin
> db

Checkout the MongoDB docs on getting started with the mongo shell.

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!