File tree Expand file tree Collapse file tree 1 file changed +1
-24
lines changed Expand file tree Collapse file tree 1 file changed +1
-24
lines changed Original file line number Diff line number Diff line change @@ -16,30 +16,7 @@ cursor.forEach()
16
16
17
17
JavaScript function to apply to each document from the
18
18
cursor. The ``<function>`` signature includes a single argument
19
- that is passed the current document to process, as in the
20
- following prototype:
21
-
22
- .. code-block:: javascript
23
-
24
- function(doc) {
25
- ...
26
- }
27
-
28
- However, if the signature is missing the argument, you can
29
- access the document using the reserved
30
- ``arguments`` [#arguments]_ variable within the function,
31
- specifically ``arguments[0]``, as in the following prototype:
32
-
33
- .. code-block:: javascript
34
-
35
- function() {
36
- doc = arguments[0];
37
- ...
38
- }
39
-
40
- .. [#arguments] The ``arguments`` variable is an array
41
- and thus, you can access ``arguments.length`` attribute to
42
- determine the number of arguments.
19
+ that is passed the current document to process.
43
20
44
21
The following example invokes the :method:`~cursor.forEach()` method
45
22
on the cursor returned by :method:`~db.collection.find()` to print
You can’t perform that action at this time.
0 commit comments