mirror of
https://github.com/macintoshplus/mongo-php-driver.git
synced 2026-04-25 17:38:09 +02:00
Merged pull request #915
This commit is contained in:
@@ -199,7 +199,15 @@ function is_mongos($uri)
|
||||
*/
|
||||
function is_replica_set($uri)
|
||||
{
|
||||
return get_primary_server($uri)->getType() === Server::TYPE_RS_PRIMARY;
|
||||
if (get_primary_server($uri)->getType() !== Server::TYPE_RS_PRIMARY) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (get_uri_option($uri, 'replicaSet') === NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user