svn: /phpdoc/en/trunk/reference/mongodb/mongodb/driver/cursor/ getid.xml getserver.xml
| From: | Jeremy Mikola | Date: | Wed, 04 Nov 2015 19:55:44 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/mongodb/mongodb/driver/cursor/ getid.xml getserver.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-13830@lists.php.net to get a copy of this message | ||
jmikola Wed, 04 Nov 2015 19:55:44 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=338087
Log:
Revise MongoDB\Driver\Cursor getId() and getServer() docs
Changed paths:
U phpdoc/en/trunk/reference/mongodb/mongodb/driver/cursor/getid.xml
U phpdoc/en/trunk/reference/mongodb/mongodb/driver/cursor/getserver.xml
Modified: phpdoc/en/trunk/reference/mongodb/mongodb/driver/cursor/getid.xml
===================================================================
--- phpdoc/en/trunk/reference/mongodb/mongodb/driver/cursor/getid.xml 2015-11-04 19:54:56 UTC (rev
338086)
+++ phpdoc/en/trunk/reference/mongodb/mongodb/driver/cursor/getid.xml 2015-11-04 19:55:44 UTC (rev
338087)
@@ -4,7 +4,7 @@
<refentry xml:id="mongodb-driver-cursor.getid" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>MongoDB\Driver\Cursor::getId</refname>
- <refpurpose>Returns the CursorId for this cursor</refpurpose>
+ <refpurpose>Returns the CursorId for this Cursor</refpurpose>
</refnamediv>
<refsect1 role="description">
@@ -14,9 +14,9 @@
<void />
</methodsynopsis>
<para>
-
+ Returns the <classname>MongoDB\Driver\CursorId</classname> associated with
+ this cursor. A cursor ID cursor uniquely identifies the cursor on the server.
</para>
-
</refsect1>
<refsect1 role="parameters">
@@ -27,15 +27,15 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
-
+ Returns the <classname>MongoDB\Driver\CursorId</classname> for this Cursor.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
- <para>
-
- </para>
+ <simplelist>
+ &mongodb.throws.argumentparsing;
+ </simplelist>
</refsect1>
@@ -47,15 +47,31 @@
<![CDATA[
<?php
-/* ... */
+/* In this example, we insert several documents into the collection and specify
+ * a smaller batchSize to ensure that the first batch contains only a subset of
+ * our results and the cursor remains open on the server. */
+$manager = new MongoDB\Driver\Manager("mongodb://localhost:27017");
+$query = new MongoDB\Driver\Query([], ['batchSize' => 2]);
+$bulk = new MongoDB\Driver\BulkWrite;
+$bulk->insert(['x' => 1]);
+$bulk->insert(['x' => 1]);
+$bulk->insert(['x' => 1]);
+$manager->executeBulkWrite('db.collection', $bulk);
+
+$cursor = $manager->executeQuery('db.collection', $query);
+var_dump($cursor->getId());
+
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
-...
+object(MongoDB\Driver\CursorId)#5 (1) {
+ ["id"]=>
+ int(94810124093)
+}
]]>
</screen>
</example>
@@ -65,7 +81,7 @@
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
- <member></member>
+ <member><classname>MongoDB\Driver\CursorId</classname></member>
</simplelist>
</refsect1>
Modified: phpdoc/en/trunk/reference/mongodb/mongodb/driver/cursor/getserver.xml
===================================================================
--- phpdoc/en/trunk/reference/mongodb/mongodb/driver/cursor/getserver.xml 2015-11-04 19:54:56 UTC
(rev 338086)
+++ phpdoc/en/trunk/reference/mongodb/mongodb/driver/cursor/getserver.xml 2015-11-04 19:55:44 UTC
(rev 338087)
@@ -14,7 +14,8 @@
<void />
</methodsynopsis>
<para>
-
+ Returns the <classname>MongoDB\Driver\Server</classname> associated with this
+ cursor. This is the server that executed the query or command.
</para>
</refsect1>
@@ -27,15 +28,15 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
-
+ Returns the <classname>MongoDB\Driver\Server</classname> for this Cursor.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
- <para>
-
- </para>
+ <simplelist>
+ &mongodb.throws.argumentparsing;
+ </simplelist>
</refsect1>
@@ -47,15 +48,64 @@
<![CDATA[
<?php
-/* ... */
+$manager = new MongoDB\Driver\Manager("mongodb://localhost:27017");
+$query = new MongoDB\Driver\Query([]);
+$bulk = new MongoDB\Driver\BulkWrite;
+$bulk->insert(['x' => 1]);
+$manager->executeBulkWrite('db.collection', $bulk);
+
+$cursor = $manager->executeQuery('db.collection', $query);
+var_dump($cursor->getServer());
+
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
-...
+object(MongoDB\Driver\Server)#5 (10) {
+ ["host"]=>
+ string(9) "localhost"
+ ["port"]=>
+ int(27017)
+ ["type"]=>
+ int(1)
+ ["is_primary"]=>
+ bool(false)
+ ["is_secondary"]=>
+ bool(false)
+ ["is_arbiter"]=>
+ bool(false)
+ ["is_hidden"]=>
+ bool(false)
+ ["is_passive"]=>
+ bool(false)
+ ["last_is_master"]=>
+ array(8) {
+ ["ismaster"]=>
+ bool(true)
+ ["maxBsonObjectSize"]=>
+ int(16777216)
+ ["maxMessageSizeBytes"]=>
+ int(48000000)
+ ["maxWriteBatchSize"]=>
+ int(1000)
+ ["localTime"]=>
+ object(MongoDB\BSON\UTCDateTime)#6 (1) {
+ ["milliseconds"]=>
+ int(1446505367907)
+ }
+ ["maxWireVersion"]=>
+ int(3)
+ ["minWireVersion"]=>
+ int(0)
+ ["ok"]=>
+ float(1)
+ }
+ ["round_trip_time"]=>
+ int(584)
+}
]]>
</screen>
</example>
@@ -65,7 +115,7 @@
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
- <member></member>
+ <member><classname>MongoDB\Driver\Server</classname></member>
</simplelist>
</refsect1>