Pregunta

Is it possible to select a database that MongoDB should use on startup in the mongorc.js?

use dbname

is not functioning. This is a Non-JavaScript macro.

¿Fue útil?

Solución

The db-name is an option when starting the mongo javascript shell.

mongo

mongo --help

You can also do something similar like this from the js file

db = db.getSiblingDB("dbname")

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top