Passing Database connection
You can use the connect function, which returns the default connection.

Just add mongoose.connect('mongodb://username:password@host:port/database'); whenever you need it.

See http://mongoosejs.com/docs/connections.html