File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,9 @@ cursor.toArray()
6
6
7
7
.. method:: cursor.toArray()
8
8
9
- The :method:`toArray() <cursor.toArray()>` method iterates a cursor
10
- completely to retrieve the documents and return these documents in
11
- an array. The :method:`toArray() <cursor.toArray()>` method loads
12
- into RAM all documents returned by the cursor and exhausts the
9
+ The :method:`toArray() <cursor.toArray()>` method returns an array
10
+ that contains all the documents from a cursor. The method loads all
11
+ the documents returned by the cursor into RAM and exhausts the
13
12
cursor.
14
13
15
14
:returns: An array of documents.
@@ -20,9 +19,9 @@ Consider the following example that applies :method:`toArray()
20
19
21
20
.. code-block:: javascript
22
21
23
- var docArray = db.products.find().toArray();
22
+ var allProductsArray = db.products.find().toArray();
24
23
25
- if (docArray .length > 0) { printjson (docArray [0]); }
24
+ if (allProductsArray .length > 0) { printjson (allProductsArray [0]); }
26
25
27
- The variable ``docArray `` holds the array of documents returned by
26
+ The variable ``allProductsArray `` holds the array of documents returned by
28
27
:method:`toArray() <cursor.toArray()>`.
You can’t perform that action at this time.
0 commit comments