mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
added timeout info
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@307744 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
95d482af34
commit
7b95acba7c
8 changed files with 174 additions and 1 deletions
|
@ -144,6 +144,24 @@ $mongo->selectDB("foo")->command(array("distinct" => "bar", "key" => "age"));
|
|||
for details.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>"username"</literal>
|
||||
</para>
|
||||
<para>
|
||||
The username can be specified here, instead of including it in the
|
||||
host list. This is especially useful if a username has a ":" in it.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>"password"</literal>
|
||||
</para>
|
||||
<para>
|
||||
The password can be specified here, instead of including it in the
|
||||
host list. This is especially useful if a password has a "@" in it.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
|
@ -238,6 +256,13 @@ $mongo->selectDB("foo")->command(array("distinct" => "bar", "key" => "age"));
|
|||
Added the <literal>replicaSet</literal> option.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1.1.4</entry>
|
||||
<entry>
|
||||
Added the <literal>username</literal> and <literal>password</literal>
|
||||
options.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
|
|
@ -108,6 +108,18 @@
|
|||
Mongo complains about the index name being too long.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>"timeout"</literal>
|
||||
</para>
|
||||
<para>
|
||||
Integer, defaults to <literal>MongoCursor::$timeout</literal>. If
|
||||
"safe" is set, this sets how long (in milliseconds) for the client to
|
||||
wait for a database response. If the database does not respond within
|
||||
the timeout period, a <classname>MongoCursorTimeoutException</classname>
|
||||
will be thrown.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
|
@ -151,6 +163,12 @@
|
|||
(either generated or set) is longer than 128 bytes.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1.2.0</entry>
|
||||
<entry>
|
||||
Added timeout option.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
|
|
@ -83,6 +83,18 @@
|
|||
and will override setting <literal>safe</literal> to &false;.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>"timeout"</literal>
|
||||
</para>
|
||||
<para>
|
||||
Integer, defaults to <literal>MongoCursor::$timeout</literal>. If
|
||||
"safe" is set, this sets how long (in milliseconds) for the client to
|
||||
wait for a database response. If the database does not respond within
|
||||
the timeout period, a <classname>MongoCursorTimeoutException</classname>
|
||||
will be thrown.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
|
@ -146,6 +158,12 @@
|
|||
Disconnects on "not master" errors if "safe" is set.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1.2.0</entry>
|
||||
<entry>
|
||||
Added timeout option.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
|
|
@ -86,6 +86,18 @@
|
|||
and will override setting <literal>safe</literal> to &false;.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>"timeout"</literal>
|
||||
</para>
|
||||
<para>
|
||||
Integer, defaults to <literal>MongoCursor::$timeout</literal>. If
|
||||
"safe" is set, this sets how long (in milliseconds) for the client to
|
||||
wait for a database response. If the database does not respond within
|
||||
the timeout period, a <classname>MongoCursorTimeoutException</classname>
|
||||
will be thrown.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
|
@ -151,6 +163,12 @@
|
|||
Disconnects on "not master" errors if "safe" is set.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1.2.0</entry>
|
||||
<entry>
|
||||
Added timeout option.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
|
|
@ -82,6 +82,18 @@
|
|||
and will override setting <literal>safe</literal> to &false;.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>"timeout"</literal>
|
||||
</para>
|
||||
<para>
|
||||
Integer, defaults to <literal>MongoCursor::$timeout</literal>. If
|
||||
"safe" is set, this sets how long (in milliseconds) for the client to
|
||||
wait for a database response. If the database does not respond within
|
||||
the timeout period, a <classname>MongoCursorTimeoutException</classname>
|
||||
will be thrown.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
|
@ -144,6 +156,12 @@
|
|||
Disconnects on "not master" errors if "safe" is set.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1.2.0</entry>
|
||||
<entry>
|
||||
Added timeout option.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
|
|
@ -114,6 +114,18 @@
|
|||
and will override setting <literal>safe</literal> to &false;.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>"timeout"</literal>
|
||||
</para>
|
||||
<para>
|
||||
Integer, defaults to <literal>MongoCursor::$timeout</literal>. If
|
||||
"safe" is set, this sets how long (in milliseconds) for the client to
|
||||
wait for a database response. If the database does not respond within
|
||||
the timeout period, a <classname>MongoCursorTimeoutException</classname>
|
||||
will be thrown.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
|
@ -181,6 +193,12 @@
|
|||
Disconnects on "not master" errors if "safe" is set.
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1.2.0</entry>
|
||||
<entry>
|
||||
Added timeout option.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>array</type><methodname>MongoDB::command</methodname>
|
||||
<methodparam><type>array</type><parameter>data</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter>options</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Almost everything that is not a CRUD operation can be done with a database command.
|
||||
|
@ -18,7 +19,7 @@
|
|||
There's a command for that. Need to turn up logging? You get the idea.
|
||||
</para>
|
||||
<para>
|
||||
This method is identical to the function:
|
||||
This method is identical to:
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
@ -46,9 +47,48 @@ public function command($data) {
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<parameter>options</parameter>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Options for this command. Right now the only option is
|
||||
<literal>timeout</literal>, which is the number of milliseconds for the
|
||||
client to wait for a database response. Set to -1 to wait forever.
|
||||
This defaults to <literal>MongoCursor::$timeout</literal>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<para>
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1.2.0</entry>
|
||||
<entry>
|
||||
Added <literal>options</literal> parameter with a single option:
|
||||
<literal>timeout</literal>.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
|
|
@ -20,6 +20,24 @@
|
|||
touch a number of collections lightly, or process some results on the
|
||||
database side to reduce the amount that has to be sent to the client.
|
||||
</para>
|
||||
<para>
|
||||
Running JavaScript in the database takes a write lock, meaning it blocks
|
||||
other operations. Make sure you consider this before running a long script.
|
||||
</para>
|
||||
<para>
|
||||
This is a wrapper for a database command. This method is basically:
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
public function execute($code, $args) {
|
||||
return $this->command(array('$eval' => $code, args => $args));
|
||||
}
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
|
Loading…
Reference in a new issue