Setting default database for MongoDB shell
Command Line You can select the database to use on the mongo command line, eg for ‘mydb’: mongo mydb If a database name is not provided, ‘test’ will be used. In .mongorc.js If you want to set a default database without specifying on the command line each time, you can add a line to the … Read more