Skip to content

Commit 1564f61

Browse files
committed
edits
1 parent 6e0dcb6 commit 1564f61

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

source/read/cursor.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Access Data From a Cursor
1515
:values: reference
1616

1717
.. meta::
18-
:keywords: read, results, oplog
18+
:keywords: read, results, code example
1919

2020
Overview
2121
--------
@@ -39,7 +39,7 @@ database from the :atlas:`Atlas sample datasets </sample-data>`. To access this
3939
from your PHP application, instantiate a ``MongoDB\Client`` that connects to an Atlas cluster
4040
and assign the following value to your ``collection`` variable:
4141

42-
.. literalinclude:: /includes/read/distinct.php
42+
.. literalinclude:: /includes/read/cursor.php
4343
:language: php
4444
:dedent:
4545
:start-after: start-db-coll
@@ -71,9 +71,9 @@ cursor returned by the ``find()`` method:
7171
.. output::
7272
:visible: false
7373

74-
{ "_id" : { "$oid" : "..." }, ... "name" : "Dunkin' Donuts", "restaurant_id" : "40379573" }
75-
{ "_id" : { "$oid" : "..." }, ... "name" : "Dunkin' Donuts", "restaurant_id" : "40363098" }
76-
{ "_id" : { "$oid" : "..." }, ... "name" : "Dunkin' Donuts", "restaurant_id" : "40395071" }
74+
{"_id":{"$oid":"..."},..."name":"Dunkin' Donuts","restaurant_id":"40379573"}
75+
{"_id":{"$oid":"..."},..."name":"Dunkin' Donuts","restaurant_id":"40363098"}
76+
{"_id":{"$oid":"..."},..."name":"Dunkin' Donuts","restaurant_id":"40395071"}
7777
...
7878

7979
Retrieve Documents Individually
@@ -99,7 +99,7 @@ of ``'Dunkin' Donuts'``. Then, it prints the first retrieved document by calling
9999

100100
.. output::
101101

102-
{ "_id" : { "$oid" : "..." }, ... "name" : "Dunkin' Donuts", "restaurant_id" : "40379573" }
102+
{"_id":{"$oid":"..."},..."name":"Dunkin' Donuts","restaurant_id":"40379573"}
103103

104104
Retrieve All Documents
105105
----------------------
@@ -151,8 +151,8 @@ collection. After the cursor is exhausted, it remains open until retrieving thre
151151

152152
.. output::
153153

154-
{ "_id" : { "$oid" : "..." }, "name" : "cauliflower" }
155-
{ "_id" : { "$oid" : "..." }, "name" : "zucchini" }
154+
{"_id":{"$oid":"..."},"name":"cauliflower"}
155+
{"_id":{"$oid":"..."},"name":"zucchini"}
156156

157157
If you insert another document into the ``vegetables`` collection, the preceding code prints
158158
the new document and closes the ``while`` loop.
@@ -167,9 +167,9 @@ To learn more about read operations, see the :ref:`php-retrieve` guide.
167167

168168
To learn more about cursors, see the following pages in the PHP manual:
169169

170-
- `MongoDB\Driver\Cursor <{+php-manual+}/class.mongodb-driver-cursor.php>`__
171-
- `MongoDB\Driver\Cursor::current() <{+php-manual+}/mongodb-driver-cursor.current.php>`__
172-
- `MongoDB\Driver\Cursor::toArray() <{+php-manual+}/mongodb-driver-cursor.toarray.php>`__
170+
- `MongoDB\\Driver\\Cursor <{+php-manual+}/class.mongodb-driver-cursor.php>`__
171+
- `MongoDB\\Driver\\Cursor::current() <{+php-manual+}/mongodb-driver-cursor.current.php>`__
172+
- `MongoDB\\Driver\\Cursor::toArray() <{+php-manual+}/mongodb-driver-cursor.toarray.php>`__
173173

174174
API Documentation
175175
~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)