forked from mongodb/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
apiargs-command-mapReduce-field.yaml
179 lines (168 loc) · 4.41 KB
/
apiargs-command-mapReduce-field.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
arg_name: field
description: |
The name of the collection on which you want to perform map-reduce.
This collection will be filtered using ``query`` before being processed
by the ``map`` function.
interface: command
name: mapReduce
operation: mapReduce
optional: false
position: 0
type: collection
---
arg_name: field
description: |
A JavaScript function that associates or "maps" a ``value`` with a
``key`` and emits the ``key`` and value ``pair``.
See :ref:`mapReduce-map-cmd` for more information.
interface: command
name: map
operation: mapReduce
optional: false
position: 1
type: function
---
arg_name: field
description: |
A JavaScript function that "reduces" to a single object all the
``values`` associated with a particular ``key``.
See :ref:`mapReduce-reduce-cmd` for more information.
interface: command
name: reduce
operation: mapReduce
optional: false
position: 2
type: function
---
arg_name: field
description: |
Follows the ``reduce`` method and modifies the output.
See :ref:`mapReduce-finalize-cmd` for more information.
interface: command
name: finalize
operation: mapReduce
optional: true
position: 7
type: function
---
arg_name: field
description: |
Specifies where to output the result of the map-reduce operation. You
can either output to a collection or return the result inline. On a
:term:`primary` member of a replica set you can output either to a collection
or inline, but on a :term:`secondary`, only inline output is
possible.
See :ref:`mapReduce-out-cmd` for more information.
interface: command
name: out
operation: mapReduce
optional: false
position: 3
type: string or document
---
arg_name: field
description: |
Specifies the selection criteria using :doc:`query operators
</reference/operator>` for determining the documents input to the
``map`` function.
interface: command
name: query
operation: mapReduce
optional: true
position: 4
type: document
---
arg_name: field
description: |
Sorts the *input* documents. This option is useful for
optimization. For example, specify the sort key to be the same as
the emit key so that there are fewer reduce operations. The sort key
must be in an existing index for this collection.
interface: command
name: sort
operation: mapReduce
optional: true
position: 5
type: document
---
arg_name: field
description: |
Specifies a maximum number of documents for the input into the
``map`` function.
interface: command
name: limit
operation: mapReduce
optional: true
position: 6
type: number
---
arg_name: field
description: |
Specifies global variables that are accessible in the ``map``,
``reduce`` and ``finalize`` functions.
interface: command
name: scope
operation: mapReduce
optional: true
position: 8
type: document
---
arg_name: field
description: |
Specifies whether to convert intermediate data into BSON
format between the execution of the ``map`` and ``reduce``
functions. Defaults to ``false``.
If ``false``:
- Internally, MongoDB converts the JavaScript objects emitted
by the ``map``
function to BSON objects. These BSON
objects are then converted back to JavaScript objects when
calling the ``reduce`` function.
- The map-reduce operation places the intermediate BSON objects
in temporary, on-disk storage. This allows the map-reduce
operation to execute over arbitrarily large data sets.
If ``true``:
- Internally, the JavaScript objects emitted during ``map``
function remain as JavaScript objects. There is no need to
convert the objects for the ``reduce`` function, which
can result in faster execution.
- You can only use ``jsMode`` for result sets with fewer than
500,000 distinct ``key`` arguments to the mapper's ``emit()``
function.
The ``jsMode`` defaults to false.
interface: command
name: jsMode
operation: mapReduce
optional: true
position: 9
type: boolean
---
arg_name: field
description: |
Specifies whether to include the ``timing`` information in the
result information. The ``verbose`` defaults to ``true`` to include
the ``timing`` information.
interface: command
name: verbose
operation: mapReduce
optional: true
position: 10
type: Boolean
---
name: bypassDocumentValidation
source:
ref: bypassDocumentValidation
file: apiargs-dbcommand-insert-field.yaml
operation: mapReduce
interface: command
position: 11
replacement:
verb: "insert"
---
arg_name: field
operation: mapReduce
source:
file: apiargs-dbcommand-aggregate-field.yaml
ref: collation
position: 12
...