mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
Document MongoDB maxTimeMS command/query option
Also expanded upon aggregate command options. https://jira.mongodb.org/browse/PHP-1023 git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@333265 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
3d104ce431
commit
4fc4e25cbd
6 changed files with 106 additions and 33 deletions
|
@ -1735,6 +1735,7 @@ paths</simpara></warning>
|
|||
<!ENTITY mongo.setwriteconcern.returnvalues '<para xmlns="http://docbook.org/ns/docbook">Returns &true; on success, or &false; otherwise.</para>'>
|
||||
<!ENTITY mongo.setwriteconcern.errors '<para xmlns="http://docbook.org/ns/docbook">Emits <constant>E_WARNING</constant> if the <literal>w</literal> parameter is not an integer or string value.</para>'>
|
||||
<!ENTITY mongo.getwriteconcern.returnvalues '<para xmlns="http://docbook.org/ns/docbook">This function returns an array describing the write concern. The array contains the values <literal>w</literal> for an integer acknowledgement level or string mode, and <literal>wtimeout</literal> denoting the maximum number of milliseconds to wait for the server to satisfy the write concern.</para>'>
|
||||
<!ENTITY mongo.command.parameters.maxtimems '<listitem xmlns="http://docbook.org/ns/docbook"><para><literal>"maxTimeMS"</literal></para><para>Specifies a cumulative time limit in milliseconds for processing the operation (does not include idle time). If the operation is not completed within the timeout period, a <classname>MongoExecutionTimeoutException</classname> will be thrown.</para></listitem>'>
|
||||
<!ENTITY mongo.writes.parameters.writeconcern '<listitem xmlns="http://docbook.org/ns/docbook"><para><literal>"w"</literal></para><para>See <link linkend="mongo.writeconcerns">WriteConcerns</link>. The default value for <classname>MongoClient</classname> is <literal>1</literal>.</para></listitem>'>
|
||||
<!ENTITY mongo.writes.parameters.writeconcerntimeout '<listitem xmlns="http://docbook.org/ns/docbook"><para><literal>"wtimeout"</literal></para><para>How long to wait for <link linkend="mongo.writeconcerns">WriteConcern</link> acknowledgement. The default value for <classname>MongoClient</classname> is <literal>10000</literal> milliseconds.</para><warning><para>Deprecated in favour of the <literal>"wTimeoutMS"</literal> option</para></warning></listitem>'>
|
||||
<!ENTITY mongo.writes.parameters.writeconcerntimeoutms '<listitem xmlns="http://docbook.org/ns/docbook"><para><literal>"wTimeoutMS"</literal></para><para>How long to wait for <link linkend="mongo.writeconcerns">WriteConcern</link> acknowledgement. The default value for <classname>MongoClient</classname> is <literal>10000</literal> milliseconds.</para></listitem>'>
|
||||
|
|
|
@ -48,9 +48,26 @@
|
|||
<varlistentry>
|
||||
<term><parameter>options</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Array of command arguments, such as <literal>allowDiskUse</literal>, <literal>explain</literal> or <literal>cursor</literal>.
|
||||
</para>
|
||||
<para>Options for the aggregation command. Valid options include:</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><literal>"allowDiskUse"</literal></para>
|
||||
<para>Allow aggregation stages to write to temporary files</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><literal>"cursor"</literal></para>
|
||||
<para>
|
||||
Options controlling the creation of the cursor object. If you need to
|
||||
use this option, you should consider using
|
||||
<methodname>MongoCollection::aggregateCursor</methodname>.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><literal>"explain"</literal></para>
|
||||
<para>Return information on the processing of the pipeline.</para>
|
||||
</listitem>
|
||||
&mongo.command.parameters.maxtimems;
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
@ -528,6 +545,7 @@ array(2) {
|
|||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member><methodname>MongoCollection::aggregateCursor</methodname></member>
|
||||
<member>The MongoDB <link xlink:href="&url.mongodb.docs.aggregation;">aggregation framework</link></member>
|
||||
</simplelist>
|
||||
</refsect1>
|
||||
|
|
|
@ -39,24 +39,23 @@
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<parameter>options</parameter>
|
||||
</term>
|
||||
<term><parameter>options</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Options for the aggregation commant.
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>"cursor"</literal>
|
||||
</para>
|
||||
<para>
|
||||
It is possible to configure how many initial documents the server
|
||||
should return with the first result set. The default initial batch size
|
||||
is <literal>101</literal>. You can change it by adding the
|
||||
<literal>cursor</literal> option:
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<para>Options for the aggregation command. Valid options include:</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para><literal>"allowDiskUse"</literal></para>
|
||||
<para>Allow aggregation stages to write to temporary files</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><literal>"cursor"</literal></para>
|
||||
<para>
|
||||
It is possible to configure how many initial documents the server
|
||||
should return with the first result set. The default initial batch size
|
||||
is <literal>101</literal>. You can change it by adding the
|
||||
<literal>batchSize</literal> option:
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$collection->aggregateCursor(
|
||||
|
@ -64,16 +63,24 @@ $collection->aggregateCursor(
|
|||
[ "cursor" => [ "batchSize" => 4 ] ]
|
||||
);
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
This option does only configure the first batch size. To configure the
|
||||
size of future batches, please use the
|
||||
<methodname>MongoCommandCursor::batchSize</methodname> method on the
|
||||
returned <classname>MongoCommandCursor</classname> object.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</programlisting>
|
||||
<para>
|
||||
This option only configures the size of the first batch. To configure
|
||||
the size of future batches, please use the
|
||||
<methodname>MongoCommandCursor::batchSize</methodname> method on the
|
||||
returned <classname>MongoCommandCursor</classname> object.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para><literal>"explain"</literal></para>
|
||||
<para>
|
||||
Return information on the processing of the pipeline. If you need to
|
||||
use this option, you should consider using
|
||||
<methodname>MongoCollection::aggregate</methodname>.
|
||||
</para>
|
||||
</listitem>
|
||||
&mongo.command.parameters.maxtimems;
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
<modifier>public</modifier> <type>array</type><methodname>MongoCollection::findOne</methodname>
|
||||
<methodparam choice="opt"><type>array</type><parameter>query</parameter><initializer>array()</initializer></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter>fields</parameter><initializer>array()</initializer></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter>options</parameter><initializer>array()</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
As opposed to <function>MongoCollection::find</function>, this method
|
||||
|
@ -58,15 +59,32 @@
|
|||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<parameter>options</parameter>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
This parameter is an associative array of the form
|
||||
<literal>array("name" => <value>, ...)</literal>. Currently
|
||||
supported options are:
|
||||
</para>
|
||||
<itemizedlist>
|
||||
&mongo.command.parameters.maxtimems;
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns record matching the search or &null;.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="errors">
|
||||
&reftitle.errors;
|
||||
<para>
|
||||
|
@ -74,7 +92,29 @@
|
|||
database.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
<refsect1 role="changelog"><!-- {{{ -->
|
||||
&reftitle.changelog;
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1.5.0</entry>
|
||||
<entry>
|
||||
Added optional <parameter>options</parameter> argument.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1><!-- }}} -->
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
|
|
|
@ -85,6 +85,7 @@
|
|||
reduce function.
|
||||
</para>
|
||||
</listitem>
|
||||
&mongo.command.parameters.maxtimems;
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -111,6 +112,10 @@
|
|||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>1.5.0</entry>
|
||||
<entry>Added <literal>"maxTimeMS"</literal> option.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>1.2.11</entry>
|
||||
<entry>
|
||||
|
|
|
@ -12,10 +12,12 @@
|
|||
<section xml:id="mongoexecutiontimeoutexception.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
Throw when a operation times out server side (e.g. in MongoDB).
|
||||
Thrown when a operation times out server side (i.e. in MongoDB).
|
||||
</para>
|
||||
<para>
|
||||
To configure the operation timeout threshold, use <methodname>MongoCursor::maxTimeMS</methodname>
|
||||
To configure the operation timeout threshold, use
|
||||
<methodname>MongoCursor::maxTimeMS</methodname> or the
|
||||
<literal>"maxTimeMS"</literal> command option.
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
|
Loading…
Reference in a new issue