svn: /phpdoc/en/trunk/reference/mongo/mongocollection/ aggregate.xml
| From: | Hannes Magnusson | Date: | Wed, 31 Oct 2012 19:08:56 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/mongo/mongocollection/ aggregate.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-10638@lists.php.net to get a copy of this message | ||
bjori Wed, 31 Oct 2012 19:08:56 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=328207
Log:
Last minute changes in the return document :]
Changed paths:
U phpdoc/en/trunk/reference/mongo/mongocollection/aggregate.xml
Modified: phpdoc/en/trunk/reference/mongo/mongocollection/aggregate.xml
===================================================================
--- phpdoc/en/trunk/reference/mongo/mongocollection/aggregate.xml 2012-10-31 16:32:58 UTC (rev
328206)
+++ phpdoc/en/trunk/reference/mongo/mongocollection/aggregate.xml 2012-10-31 19:08:56 UTC (rev
328207)
@@ -62,10 +62,35 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
- The result of the aggregation as an array.
+ The result of the aggregation as an array. The <varname>ok</varname> will
+ be set to <literal>1</literal> on success, <literal>0</literal> on
failure.
</para>
</refsect1>
+ <refsect1 role="errors">
+ &reftitle.errors;
+ <para>
+ When an error occurs an array with the following keys will be returned:
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ <varname>errmsg</varname> - containing the reason for the failure
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <varname>code</varname> - the errorcode of the failure
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <varname>ok</varname> - will be set to 0.
+ </simpara>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </refsect1>
+
<refsect1 role="examples">
&reftitle.examples;
<example xml:id="mongocollection.aggregate.example.basic">
@@ -126,32 +151,37 @@
<screen>
<![CDATA[
array(2) {
- [0]=>
+ ["result"]=>
array(2) {
- ["_id"]=>
- array(1) {
- ["tags"]=>
- string(4) "good"
+ [0]=>
+ array(2) {
+ ["_id"]=>
+ array(1) {
+ ["tags"]=>
+ string(4) "good"
+ }
+ ["authors"]=>
+ array(1) {
+ [0]=>
+ string(3) "bob"
+ }
}
- ["authors"]=>
- array(1) {
- [0]=>
- string(3) "bob"
+ [1]=>
+ array(2) {
+ ["_id"]=>
+ array(1) {
+ ["tags"]=>
+ string(3) "fun"
+ }
+ ["authors"]=>
+ array(1) {
+ [0]=>
+ string(3) "bob"
+ }
}
}
- [1]=>
- array(2) {
- ["_id"]=>
- array(1) {
- ["tags"]=>
- string(3) "fun"
- }
- ["authors"]=>
- array(1) {
- [0]=>
- string(3) "bob"
- }
- }
+ ["ok"]=>
+ float(1)
}
]]>
</screen>
@@ -191,29 +221,61 @@
&example.outputs.similar;
<screen>
<![CDATA[
-array(7) {
- [0]=>
- array(2) {
- ["_id"]=>
- string(2) "TX"
- ["totalPop"]=>
- int(16986510)
+array(2) {
+ ["result"]=>
+ array(7) {
+ [0]=>
+ array(2) {
+ ["_id"]=>
+ string(2) "TX"
+ ["totalPop"]=>
+ int(16986510)
+ }
+ [1]=>
+ array(2) {
+ ["_id"]=>
+ string(2) "PA"
+ ["totalPop"]=>
+ int(11881643)
+ }
+ [2]=>
+ array(2) {
+ ["_id"]=>
+ string(2) "NY"
+ ["totalPop"]=>
+ int(17990455)
+ }
+ [3]=>
+ array(2) {
+ ["_id"]=>
+ string(2) "IL"
+ ["totalPop"]=>
+ int(11430602)
+ }
+ [4]=>
+ array(2) {
+ ["_id"]=>
+ string(2) "CA"
+ ["totalPop"]=>
+ int(29760021)
+ }
+ [5]=>
+ array(2) {
+ ["_id"]=>
+ string(2) "OH"
+ ["totalPop"]=>
+ int(10847115)
+ }
+ [6]=>
+ array(2) {
+ ["_id"]=>
+ string(2) "FL"
+ ["totalPop"]=>
+ int(12937926)
+ }
}
- [1]=>
- array(2) {
- ["_id"]=>
- string(2) "PA"
- ["totalPop"]=>
- int(11881643)
- }
-....
- [6]=>
- array(2) {
- ["_id"]=>
- string(2) "FL"
- ["totalPop"]=>
- int(12937926)
- }
+ ["ok"]=>
+ float(1)
}
]]>
</screen>
@@ -252,36 +314,90 @@
&example.outputs.similar;
<screen>
<![CDATA[
-array(51) {
- [0]=>
- array(2) {
- ["_id"]=>
- string(2) "DC"
- ["avgCityPop"]=>
- float(303450)
- }
- [1]=>
- array(2) {
- ["_id"]=>
- string(2) "DE"
- ["avgCityPop"]=>
- float(14481.913043478)
- }
+array(2) {
+ ["result"]=>
+ array(51) {
+ [0]=>
+ array(2) {
+ ["_id"]=>
+ string(2) "DC"
+ ["avgCityPop"]=>
+ float(303450)
+ }
+ [1]=>
+ array(2) {
+ ["_id"]=>
+ string(2) "DE"
+ ["avgCityPop"]=>
+ float(14481.913043478)
+ }
+ [2]=>
+ array(2) {
+ ["_id"]=>
+ string(2) "RI"
+ ["avgCityPop"]=>
+ float(18933.283018868)
+ }
+ [3]=>
+ array(2) {
+ ["_id"]=>
+ string(2) "AL"
+ ["avgCityPop"]=>
+ float(7907.2152641879)
+ }
+ [4]=>
+ array(2) {
+ ["_id"]=>
+ string(2) "NH"
+ ["avgCityPop"]=>
+ float(5232.320754717)
+ }
...
- [49]=>
- array(2) {
- ["_id"]=>
- string(2) "WI"
- ["avgCityPop"]=>
- float(7323.0074850299)
+ [45]=>
+ array(2) {
+ ["_id"]=>
+ string(2) "WY"
+ ["avgCityPop"]=>
+ float(3359.9111111111)
+ }
+ [46]=>
+ array(2) {
+ ["_id"]=>
+ string(2) "MN"
+ ["avgCityPop"]=>
+ float(5335.4865853659)
+ }
+ [47]=>
+ array(2) {
+ ["_id"]=>
+ string(2) "OK"
+ ["avgCityPop"]=>
+ float(6155.7436399217)
+ }
+ [48]=>
+ array(2) {
+ ["_id"]=>
+ string(2) "IL"
+ ["avgCityPop"]=>
+ float(9931.0182450043)
+ }
+ [49]=>
+ array(2) {
+ ["_id"]=>
+ string(2) "WI"
+ ["avgCityPop"]=>
+ float(7323.0074850299)
+ }
+ [50]=>
+ array(2) {
+ ["_id"]=>
+ string(2) "WV"
+ ["avgCityPop"]=>
+ float(2759.1953846154)
+ }
}
- [50]=>
- array(2) {
- ["_id"]=>
- string(2) "WV"
- ["avgCityPop"]=>
- float(2759.1953846154)
- }
+ ["ok"]=>
+ float(1)
}
]]>
</screen>