Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Multiple connections #4

Closed
mrusme opened this issue Jun 26, 2013 · 1 comment
Closed

Feature request: Multiple connections #4

mrusme opened this issue Jun 26, 2013 · 1 comment

Comments

@mrusme
Copy link

mrusme commented Jun 26, 2013

Hi,

multiple mongdb connections from within one "mongodb" database connection definiton would be super-cool. The mongodb client library allows this:

mongodb://db1.example.net,db2.example.net:2500/?replicaSet=test

It would be really nice to have it configurable within the database.php:

    'mongodb' => array(
      'db1.example.net' => array(
        'host'     => 'db1.example.net',
        'port'     => 27017,
        'database' => 'example',     
      ),
      'db2.example.net' => array(
        'host'     => 'db2.example.net',
        'port'     => 27017,
        'database' => 'example',     
      )
    ),    

What do you think?

@jenssegers
Copy link
Contributor

You should be able to do this with the following configuration array:

'mongodb' => array(
    'host'     => 'db1.example.net:27017,db2.example.net:27017',
    'database' => 'database',
    'options'  => array(
        'replicaSet' => 'myReplSetName'
    )
),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants