Mongodb is configured is the config/db.json
file with:
- The key
connectionOptions
is used to give theoption
parameter ofmongoose.connect
. - The key
connectionString
is the first parameter ofmongoose.connect
.
ConnexionString syntax :
mongodb://[username:password@]host[:port][/database]
ConnexionString example :
mongodb://myVM1/test
ConnexionString syntax :
mongodb://[username:password@]host1[:port1][/database],[,host2[:port2][/database],...[,hostN[:portN][/database]]][?replicaSet=replicaName]
ConnexionString example :
mongodb://myVM1/test,myVM2:27018/test,myVM3:27019/test?replicaSet=rs0
ConnexionString syntax :
mongodb://[username:password@]host[:port][/database]
ConnexionString example :
mongodb://myVM1/test
ConnexionString syntax :
mongodb://[username:password@]host1[:port1][/database],[,host2[:port2][/database],...[,hostN[:portN][/database]]]
ConnexionString example :
mongodb://myVM1/test,myVM2:27018/test
With option mongos
to true
. (You must add "mongos":true
as a parameter of connectionOptions
)