You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/components/pages/outputs/mongodb.adoc
+43-48Lines changed: 43 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,30 +21,30 @@ Common::
21
21
--
22
22
23
23
```yml
24
-
# Common config fields, showing default values
24
+
# Common configuration fields, showing default values
25
25
output:
26
26
label: ""
27
27
mongodb:
28
28
url: mongodb://localhost:27017 # No default (required)
29
29
database: "" # No default (required)
30
-
username: ""
31
-
password: ""
30
+
username: "" # No default (optional)
31
+
password: "" # No default (optional)
32
32
collection: "" # No default (required)
33
33
operation: update-one
34
34
write_concern:
35
-
w: ""
35
+
w: "" # No default (optional)
36
36
j: false
37
-
w_timeout: ""
38
-
document_map: ""
39
-
filter_map: ""
40
-
hint_map: ""
37
+
w_timeout: "" # No default (optional)
38
+
document_map: "" # No default (optional)
39
+
filter_map: "" # No default (optional)
40
+
hint_map: "" # No default (optional)
41
41
upsert: false
42
42
max_in_flight: 64
43
43
batching:
44
44
count: 0
45
45
byte_size: 0
46
-
period: ""
47
-
check: ""
46
+
period: "" # No default (optional)
47
+
check: "" # No default (optional)
48
48
```
49
49
50
50
--
@@ -53,31 +53,31 @@ Advanced::
53
53
--
54
54
55
55
```yml
56
-
# All config fields, showing default values
56
+
# All configuration fields, showing default values
57
57
output:
58
58
label: ""
59
59
mongodb:
60
60
url: mongodb://localhost:27017 # No default (required)
61
61
database: "" # No default (required)
62
-
username: ""
63
-
password: ""
62
+
username: "" # No default (optional)
63
+
password: "" # No default (optional)
64
64
app_name: benthos
65
65
collection: "" # No default (required)
66
66
operation: update-one
67
67
write_concern:
68
-
w: ""
68
+
w: "" # No default (optional)
69
69
j: false
70
-
w_timeout: ""
71
-
document_map: ""
72
-
filter_map: ""
73
-
hint_map: ""
70
+
w_timeout: "" # No default (optional)
71
+
document_map: "" # No default (optional)
72
+
filter_map: "" # No default (optional)
73
+
hint_map: "" # No default (optional)
74
74
upsert: false
75
75
max_in_flight: 64
76
76
batching:
77
77
count: 0
78
78
byte_size: 0
79
-
period: ""
80
-
check: ""
79
+
period: "" # No default (optional)
80
+
check: "" # No default (optional)
81
81
processors: [] # No default (optional)
82
82
```
83
83
@@ -87,9 +87,9 @@ output:
87
87
88
88
== Performance
89
89
90
-
This output benefits from sending multiple messages in flight in parallel for improved performance. You can tune the max number of in flight messages (or message batches) with the field `max_in_flight`.
90
+
This output benefits from sending multiple messages in flight, in parallel, for improved performance. You can tune the maximum number of in flight messages (or message batches) using the `max_in_flight` field.
91
91
92
-
This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. You can find out more xref:configuration:batching.adoc[in this doc].
92
+
This output benefits from sending messages as a batch for improved performance. Batches can be formed at both the input and output level. For more information, see xref:configuration:batching.adoc[Message Batching].
93
93
94
94
== Fields
95
95
@@ -117,7 +117,7 @@ The name of the target MongoDB database.
117
117
118
118
=== `username`
119
119
120
-
The username to connect to the database.
120
+
The username required to connect to the database.
121
121
122
122
123
123
*Type*: `string`
@@ -126,12 +126,11 @@ The username to connect to the database.
@@ -155,32 +154,29 @@ The name of the target collection. This field supports xref:configuration:interp
155
154
156
155
=== `operation`
157
156
158
-
The mongodb operation to perform.
159
-
157
+
The MongoDB database operation to perform.
160
158
161
159
*Type*: `string`
162
160
163
-
*Default*: `"update-one"`
161
+
*Default*: `update-one`
164
162
165
163
Options:
166
164
`insert-one`
167
165
, `delete-one`
168
166
, `delete-many`
169
167
, `replace-one`
170
168
, `update-one`
171
-
.
172
169
173
170
=== `write_concern`
174
171
175
-
The write concern settings for the mongo connection.
176
-
172
+
The https://www.mongodb.com/docs/manual/reference/write-concern/[write concern settings^] for the MongoDB connection.
177
173
178
174
*Type*: `object`
179
175
180
176
181
177
=== `write_concern.w`
182
178
183
-
W requests acknowledgement that write operations propagate to the specified number of mongodb instances.
179
+
The `w` requests acknowledgement, which write operations propagate to the specified number of MongoDB instances.
184
180
185
181
186
182
*Type*: `string`
@@ -189,8 +185,7 @@ W requests acknowledgement that write operations propagate to the specified numb
189
185
190
186
=== `write_concern.j`
191
187
192
-
J requests acknowledgement from MongoDB that write operations are written to the journal.
193
-
188
+
The `j` requests acknowledgement from MongoDB, which is created when write operations are written to the journal.
194
189
195
190
*Type*: `bool`
196
191
@@ -207,7 +202,7 @@ The write concern timeout.
207
202
208
203
=== `document_map`
209
204
210
-
A bloblang map representing a document to store within MongoDB, expressed as https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/[extended JSON in canonical form^]. The document map is required for the operationsinsert-one, replace-one and update-one.
205
+
A Bloblang map that represents a document to store in MongoDB, expressed as https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/[extended JSON in canonical form^]. The `document_map` parameter is required for the following database operations: `insert-one`, `replace-one`, and `update-one`.
211
206
212
207
213
208
*Type*: `string`
@@ -224,8 +219,9 @@ document_map: |-
224
219
225
220
=== `filter_map`
226
221
227
-
A bloblang map representing a filter for a MongoDB command, expressed as https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/[extended JSON in canonical form^]. The filter map is required for all operations except insert-one. It is used to find the document(s) for the operation. For example in a delete-one case, the filter map should have the fields required to locate the document to delete.
222
+
A Bloblang map that represents a filter for a MongoDB command, expressed as https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/[extended JSON in canonical form^]. The `filter_map` parameter is required for all database operations except `insert-one`.
228
223
224
+
This output uses `filter_map` to find documents for the specified operation. For example, for a `delete-one` operation, the filter map should include the fields required to locate the document for deletion.
229
225
230
226
*Type*: `string`
231
227
@@ -241,8 +237,9 @@ filter_map: |-
241
237
242
238
=== `hint_map`
243
239
244
-
A bloblang map representing the hint for the MongoDB command, expressed as https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/[extended JSON in canonical form^]. This map is optional and is used with all operations except insert-one. It is used to improve performance of finding the documents in the mongodb.
240
+
A Bloblang map that represents a hint or index for a MongoDB command to use, expressed as https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/[extended JSON in canonical form^]. This map is optional, and is used with all operations except `insert-one`.
245
241
242
+
Define a `hint_map` to improve performance when finding documents in the MongoDB database.
246
243
247
244
*Type*: `string`
248
245
@@ -258,17 +255,17 @@ hint_map: |-
258
255
259
256
=== `upsert`
260
257
261
-
The upsert setting is optional and only applies for update-one and replace-one operations. If the filter specified in filter_map matches, the document is updated or replaced accordingly, otherwise it is created.
262
-
258
+
The `upsert` parameter is optional, and only applies for `update-one` and `replace-one` operations. If the filter specified in `filter_map` matches an existing document, this operation updates or replaces the document, otherwise a new document is created.
263
259
264
260
*Type*: `bool`
265
261
266
262
*Default*: `false`
263
+
267
264
Requires version 3.60.0 or newer
268
265
269
266
=== `max_in_flight`
270
267
271
-
The maximum number of messages to have in flight at a given time. Increase this to improve throughput.
268
+
The maximum number of messages to have in flight at a given time. Increase this number to improve throughput.
272
269
273
270
274
271
*Type*: `int`
@@ -303,25 +300,23 @@ batching:
303
300
304
301
=== `batching.count`
305
302
306
-
A number of messages at which the batch should be flushed. If `0` disables count based batching.
307
-
303
+
The number of messages after which the batch is flushed. Set to `0` to disable count-based batching.
308
304
309
305
*Type*: `int`
310
306
311
307
*Default*: `0`
312
308
313
309
=== `batching.byte_size`
314
310
315
-
An amount of bytes at which the batch should be flushed. If `0` disables size based batching.
316
-
311
+
The number of bytes at which the batch is flushed. Set to `0` to disable size-based batching.
317
312
318
313
*Type*: `int`
319
314
320
315
*Default*: `0`
321
316
322
317
=== `batching.period`
323
318
324
-
A period in which an incomplete batch should be flushed regardless of its size.
319
+
The period after which an incomplete batch is flushed regardless of its size.
A list of xref:components:processors/about.adoc[processors] to apply to a batch as it is flushed. This allows you to aggregate and archive the batch however you see fit. Please note that all resulting messages are flushed as a single batch, therefore splitting the batch into smaller batches using these processors is a no-op.
353
+
For aggregating and archiving message batches, you can add a list of xref:components:processors/about.adoc[processors] to apply to a batch as it is flushed. All resulting messages are flushed as a single batch even when you configure processors to split the batch into smaller batches.
0 commit comments