Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into cake2.0

  • Loading branch information...
commit 29b73f8376f8db7686531570e131b82113b5321e 2 parents f392607 + d8032f0
@ichikaway authored
Showing with 7 additions and 6 deletions.
  1. +1 −1  Model/Datasource/MongodbSource.php
  2. +6 −5 README.markdown
View
2  Model/Datasource/MongodbSource.php
@@ -180,7 +180,7 @@ public function connect() {
$host = $this->createConnectionName($this->config, $this->_driverVersion);
if (isset($this->config['replicaset']) && count($this->config['replicaset']) === 2) {
- $this->connection = new Mongo($this->config['replicaset']['host'], $this->config['replicaset']['name']);
+ $this->connection = new Mongo($this->config['replicaset']['host'], $this->config['replicaset']['options']);
} else if ($this->_driverVersion >= '1.2.0') {
$this->connection = new Mongo($host, array("persist" => $this->config['persistent']));
} else {
View
11 README.markdown
@@ -40,16 +40,17 @@ To use this DB driver, install (obviously) and define a db source such as follow
/* optional auth fields
'login' => 'mongo',
'password' => 'awesomeness',
- 'replicaset' => array('host' => 'mongodb://hoge:hogehoge@localhost:27021,localhost:27022/blog', 'name' => 'myRepl'),
+ 'replicaset' => array('host' => 'mongodb://hoge:hogehoge@localhost:27021,localhost:27022/blog',
+ 'options' => array('replicaSet' => 'myRepl')
+ ),
*/
);
}
-If set 'replicaset' key, it doesn't use host, port, login, password keys.
-Please set all connection info in replicaset host and set your replicaset name in replicaset name.
-This example shows connecting to localhost:27021 or localhost:27022 with auth info(id:hoge, password:hogehoge),
-and using blog database.
+More detail of replicaset in wiki:
+https://github.com/ichikaway/cakephp-mongodb/wiki/How-to-connect-to-replicaset-servers
+
Model files need to have mongoSchema property - or make use of the schemaless behavior.
Please sign in to comment.
Something went wrong with that request. Please try again.