17/11/2015 - DOCTRINE, MONGODB, SYMFONY
In this example, we're going to use two different document manager and connections for two different bundles. For more information visit
DoctrineMongoDBBundle Configuration page.
# app/config.yml
doctrine_mongodb:
default_database: frontend_database
default_connection: frontend
default_document_manager: frontend
connections:
frontend:
server: mongodb://localhost:27017
options:
connect: true
db: frontend_database
backend:
server: mongodb://localhost:27017
options:
connect: true
db: backend_database
document_managers:
frontend:
connection: frontend
database: frontend_database
retry_connect: 3
retry_query: 3
mappings:
ApplicationFrontendBundle: ~
backend:
connection: backend
database: backend_database
retry_connect: 3
retry_query: 3
mappings:
ApplicationBackendBundle: ~
doctrine_mongodb.odm.frontend_document_manager
doctrine_mongodb.odm.backend_document_manager