In my application i have to use two different MongoDb databses. So i followed the instruction in the following link.Here is a part of my app/config.yml file
doctrine_mongodb:
default_database: music_store_database
default_connection: conn1
default_document_manager: dm1
connections:
conn1:
server: mongodb://localhost:27017
options:
connect: true
db: music_store_database
conn2:
server: mongodb://localhost:27017
options:
connect: true
db: another_database
document_managers:
dm1:
connection: conn1
mappings:
MyfirstBundle: ~
dm2:
connection: conn2
mappings:
MySecondBundle: ~
Now if i do an ./app/console cache:clear --env=prod or anything else i get this issue:
[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
The service "doctrine_mongodb.odm.conn1_connection" has a dependency on a non- existent service "doctrine_mongodb.odm.conn1_configuration".
The service "doctrine_mongodb.odm.conn1_connection" has a dependency on a non- existent service "doctrine_mongodb.odm.conn1_configuration".
I am stuck i didn't find any workaround.So i wonder what i am doing wrong? what is the right way to configure Symfony to use two MongoDb databases