Fixed PHP-314: Improve connection string documentation/pooling.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@330303 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Derick Rethans 2013-05-20 17:57:41 +00:00
parent b0b1f8f1a8
commit bc129e08ec
3 changed files with 17 additions and 5 deletions

View file

@ -100,6 +100,16 @@ $m = new MongoClient("mongodb://rs1.example.com:27017,rs2.example.com:27017", ar
server from each of your datacenters.
</para>
</tip>
<warning>
<para>
The host names that you specify here <emphasis>must</emphasis> match the
names as given in the replica set configuration because the driver uses the
name as specified in the replica set configuration as identifier in its
internal mapping. Specifying (for example) the IP address instead of the
configured host name makes that the driver keeps a connection for both the
host name and its accompanying IP address.
</para>
</warning>
<para>
If the primary becomes unavailable, an election will take place and a
secondary will be promoted to the role of primary (unless a majority vote

View file

@ -11,7 +11,7 @@
<section xml:id="mongoclient.intro">
&reftitle.intro;
<para>
A connection between PHP and MongoDB.
A connection manager for PHP and MongoDB.
</para>
<para>
This class is used to create and manage connections. A typical use is:
@ -145,8 +145,8 @@ $db = $m->foo; // get the database named "foo"
<term><constant>MongoClient::VERSION</constant></term>
<listitem>
<simpara>
PHP driver version. May be suffixed with "+" or "-" if it is in-between
versions.
PHP driver version. May be suffixed with "dev", "+" or "-" if it is
in-between versions.
</simpara>
</listitem>
</varlistentry>

View file

@ -39,10 +39,12 @@ mongodb://[username:password@]host1[:port1][,host2[:port2:],...]/db
</para>
<para>
At least one host must be given (port optional, always defaulting to 27017)
and as many hosts as desired may be connected to. Host names are
and as many hosts as desired may be connected to. Host names are
comma-separated and the constructor will return successfully if it connected
to at least one host. If it could not connect to any of the hosts, it will
throw a <classname>MongoConnectionException</classname>.
throw a <classname>MongoConnectionException</classname>. Please see the
<link linkend="mongo.connecting.rs">Replica Sets</link> section for
information on how to connect to Replica Sets.
</para>
<para>
If you specified a username and password, you may specify a database to