Hi,
I am looking for advice for use connection.database.
When i configure my mongo connection for all my app i use scala object reference lazy val that call connection.database.
It is a good pratice to do that or that can produce somme errors ? It is better to use def instead of lazy val to call connection.database ?
Object Connection {
lazy val connection: MongoConnection = //get my mongo connection
lazy val db: Future[DefaultDB] = connection.database
// or
def db: Future[DefaultDB] = connection.database
}
In fact I use :
reactiveMongoApi.database
It change something about that ?
Thx for your response.