symfony/symfony-docs — Issue #875: Additional Configuration options for DoctrineMongoDBBundle Configuration
Author: carlcasbolt
Created: 2011-11-24 15:36:11+00:00
State: open

I'd like to add some additional documentation to:
http://symfony.com/doc/2.0/bundles/DoctrineMongoDBBundle/config.html

I am working on a project at the moment which needs to connect to 3 mongodb servers at once to process read/write requests to a replica set. Rather then opening 3 connections it is possible to seperate each server name with a comma within the dsn string, and I think it would be nice to share this information.

Additional Documentation follows:

**Connecting to a pool of mongodb servers on 1 connection.**

It is possible to connect to serveral mongodb servers on one connection if you are using a replica set by listing all of the servers within the connection string as a comma seperated list.

Yaml:

```yml
doctrine_mongodb:
default_database: hello_%kernel.environment%
connections:
default:
server: 'mongodb://mongodb-01:27017,mongodb-02:27017,mongodb-03:27017'
options:
connect: true
document_managers:
default:
auto_mapping: true
```