I am trying to create to multiple collections in MongoDB using ReactiveMongo driver in Play Framework.
I am using following configurations:
application.conf: mongodb.uri = "mongodb://localhost:27017/somedb"
in my controllers class:
def userCollection = reactiveMongoApi.db.collection[BSONCollection]("user")
(I want to store user info in this collection). The code works fine till here. But when i try to add another collection in which i want to store form data of different format.
def formCollection = reactiveMongoApi.db.collection[BSONCollection("form")
and when i run this code, i get the following error:
reactivemongo.core.errors.ConnectionNotInitialized: MongoError['Connection is missing metadata (like protocol version, etc.) The connection pool is probably being initialized
How do i achieve this ??