So, been working on a smaller project with Play, ReactiveMongo and MongoDB. My question is about the application.conf
part for ReactiveMongo, have the standard googlable one:
mongodb = {
db = "db1"
servers = [ "localhost:27017" ]
credentials = {
username = "auser"
password = "apassword"
}
}
And to access a collection, in Scala:
def sessionCollection: JSONCollection = db.collection[JSONCollection]("session")
So, since MongoDB locks at database level for writes, I'm looking for a solution to use several databases.
Question is: how do I configure multiple databases so I can define collections like above, from those databases?
MongoDB 2.6.x, Play 2.3.x, Reactivemongo 0.10.5.0.akka23
Edit: I should say that I already know about this, doing it manually with code, but I wanted to know if there were any Play specific known solution I've failed to reach via Google.