@lowdefy/docs-content 0.0.0-experimental-20260710073520

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +20 -0
  3. package/content/actions/callapi.md +66 -0
  4. package/content/actions/callmethod.md +41 -0
  5. package/content/actions/copytoclipboard.md +32 -0
  6. package/content/actions/displaymessage.md +53 -0
  7. package/content/actions/downloadcsv.md +89 -0
  8. package/content/actions/fetch.md +50 -0
  9. package/content/actions/geolocationcurrentposition.md +56 -0
  10. package/content/actions/link.md +104 -0
  11. package/content/actions/login.md +85 -0
  12. package/content/actions/logout.md +56 -0
  13. package/content/actions/pdfmake.md +304 -0
  14. package/content/actions/request.md +67 -0
  15. package/content/actions/reset.md +27 -0
  16. package/content/actions/resetvalidation.md +85 -0
  17. package/content/actions/scrollto.md +85 -0
  18. package/content/actions/setdarkmode.md +62 -0
  19. package/content/actions/setfocus.md +33 -0
  20. package/content/actions/setglobal.md +63 -0
  21. package/content/actions/setlocale.md +69 -0
  22. package/content/actions/setstate.md +70 -0
  23. package/content/actions/throw.md +72 -0
  24. package/content/actions/validate.md +87 -0
  25. package/content/actions/wait.md +24 -0
  26. package/content/agents/agent-endpoint-tools.md +190 -0
  27. package/content/agents/agent-mcp-tools.md +124 -0
  28. package/content/agents/agent-multi-agent.md +136 -0
  29. package/content/agents/agent-properties.md +174 -0
  30. package/content/agents/agent-server-hooks.md +336 -0
  31. package/content/agents/agentchat.md +515 -0
  32. package/content/agents/agentconversations.md +148 -0
  33. package/content/concepts/ai-agent-docs.md +190 -0
  34. package/content/concepts/cli.md +213 -0
  35. package/content/concepts/connections-and-requests.md +7 -0
  36. package/content/concepts/custom-html.md +3 -0
  37. package/content/concepts/custom-styling.md +161 -0
  38. package/content/concepts/events-and-actions.md +271 -0
  39. package/content/concepts/hosting-files.md +18 -0
  40. package/content/concepts/i18n.md +320 -0
  41. package/content/concepts/keyboard-shortcuts.md +218 -0
  42. package/content/concepts/layout-overview.md +478 -0
  43. package/content/concepts/lists.md +144 -0
  44. package/content/concepts/logger.md +43 -0
  45. package/content/concepts/lowdefy-schema.md +365 -0
  46. package/content/concepts/menus.md +144 -0
  47. package/content/concepts/module-authoring.md +564 -0
  48. package/content/concepts/modules.md +338 -0
  49. package/content/concepts/operators.md +45 -0
  50. package/content/concepts/overview.md +19 -0
  51. package/content/concepts/references-and-templates.md +207 -0
  52. package/content/concepts/secrets.md +24 -0
  53. package/content/concepts/selectors.md +143 -0
  54. package/content/connections/amazonredshift.md +176 -0
  55. package/content/connections/anthropic.md +232 -0
  56. package/content/connections/awss3.md +313 -0
  57. package/content/connections/azureblobstorage.md +133 -0
  58. package/content/connections/elasticsearch.md +371 -0
  59. package/content/connections/google.md +228 -0
  60. package/content/connections/googlecloudstorage.md +139 -0
  61. package/content/connections/googlesheet.md +313 -0
  62. package/content/connections/knex.md +206 -0
  63. package/content/connections/mariadb.md +177 -0
  64. package/content/connections/mcp.md +134 -0
  65. package/content/connections/mongodb.md +739 -0
  66. package/content/connections/mssql.md +191 -0
  67. package/content/connections/mysql.md +192 -0
  68. package/content/connections/openai-connection.md +228 -0
  69. package/content/connections/postgresql.md +200 -0
  70. package/content/connections/redis.md +116 -0
  71. package/content/connections/sendgridmail.md +94 -0
  72. package/content/connections/smtp.md +149 -0
  73. package/content/connections/sqlite.md +187 -0
  74. package/content/connections/stripe.md +115 -0
  75. package/content/container-blocks/affix.md +413 -0
  76. package/content/container-blocks/alert.md +937 -0
  77. package/content/container-blocks/badge.md +1222 -0
  78. package/content/container-blocks/box.md +1453 -0
  79. package/content/container-blocks/card.md +1200 -0
  80. package/content/container-blocks/carousel.md +2247 -0
  81. package/content/container-blocks/collapse.md +1335 -0
  82. package/content/container-blocks/configprovider.md +1070 -0
  83. package/content/container-blocks/confirmmodal.md +1159 -0
  84. package/content/container-blocks/content.md +597 -0
  85. package/content/container-blocks/descriptions.md +870 -0
  86. package/content/container-blocks/drawer.md +1379 -0
  87. package/content/container-blocks/dropdownmenu.md +643 -0
  88. package/content/container-blocks/flex.md +1510 -0
  89. package/content/container-blocks/footer.md +380 -0
  90. package/content/container-blocks/googlemaps.md +546 -0
  91. package/content/container-blocks/googlemapsheatmap.md +607 -0
  92. package/content/container-blocks/googlemapsscript.md +61 -0
  93. package/content/container-blocks/header.md +302 -0
  94. package/content/container-blocks/label.md +739 -0
  95. package/content/container-blocks/layout.md +604 -0
  96. package/content/container-blocks/masonry.md +1090 -0
  97. package/content/container-blocks/mobilemenu.md +1244 -0
  98. package/content/container-blocks/modal.md +1180 -0
  99. package/content/container-blocks/pageheadermenu.md +614 -0
  100. package/content/container-blocks/pagesidebarlayout.md +438 -0
  101. package/content/container-blocks/pagesidermenu.md +651 -0
  102. package/content/container-blocks/popover.md +1421 -0
  103. package/content/container-blocks/result.md +972 -0
  104. package/content/container-blocks/sider.md +1064 -0
  105. package/content/container-blocks/span.md +747 -0
  106. package/content/container-blocks/spinner.md +267 -0
  107. package/content/container-blocks/splitter.md +1735 -0
  108. package/content/container-blocks/tabs.md +1718 -0
  109. package/content/container-blocks/tooltip.md +1274 -0
  110. package/content/container-blocks/watermark.md +515 -0
  111. package/content/controls/for.md +103 -0
  112. package/content/controls/if.md +107 -0
  113. package/content/controls/log.md +50 -0
  114. package/content/controls/parallel.md +71 -0
  115. package/content/controls/parallel_for.md +36 -0
  116. package/content/controls/reject.md +56 -0
  117. package/content/controls/return.md +66 -0
  118. package/content/controls/set_state.md +98 -0
  119. package/content/controls/switch.md +90 -0
  120. package/content/controls/throw.md +79 -0
  121. package/content/controls/try.md +88 -0
  122. package/content/deployment/docker.md +149 -0
  123. package/content/deployment/node-server.md +27 -0
  124. package/content/deployment/vercel.md +101 -0
  125. package/content/display-blocks/aggrid.md +1459 -0
  126. package/content/display-blocks/anchor.md +336 -0
  127. package/content/display-blocks/avatar.md +1154 -0
  128. package/content/display-blocks/breadcrumb.md +517 -0
  129. package/content/display-blocks/button.md +758 -0
  130. package/content/display-blocks/calendar.md +156 -0
  131. package/content/display-blocks/dangeroushtml.md +314 -0
  132. package/content/display-blocks/dangerousmarkdown.md +423 -0
  133. package/content/display-blocks/diffgit.md +44 -0
  134. package/content/display-blocks/difflist.md +225 -0
  135. package/content/display-blocks/diffsidebyside.md +56 -0
  136. package/content/display-blocks/difftimeline.md +94 -0
  137. package/content/display-blocks/divider.md +406 -0
  138. package/content/display-blocks/download.md +60 -0
  139. package/content/display-blocks/dropdownbutton.md +661 -0
  140. package/content/display-blocks/echart.md +418 -0
  141. package/content/display-blocks/floatbutton.md +545 -0
  142. package/content/display-blocks/html.md +311 -0
  143. package/content/display-blocks/icon.md +717 -0
  144. package/content/display-blocks/img.md +479 -0
  145. package/content/display-blocks/markdown.md +520 -0
  146. package/content/display-blocks/markdownwithcode.md +730 -0
  147. package/content/display-blocks/menu.md +1123 -0
  148. package/content/display-blocks/message.md +941 -0
  149. package/content/display-blocks/notification.md +1410 -0
  150. package/content/display-blocks/paragraph.md +643 -0
  151. package/content/display-blocks/progress.md +818 -0
  152. package/content/display-blocks/qrcode.md +519 -0
  153. package/content/display-blocks/s3download.md +240 -0
  154. package/content/display-blocks/search.md +360 -0
  155. package/content/display-blocks/skeleton.md +272 -0
  156. package/content/display-blocks/skeletonavatar.md +222 -0
  157. package/content/display-blocks/skeletonbutton.md +245 -0
  158. package/content/display-blocks/skeletoninput.md +223 -0
  159. package/content/display-blocks/skeletonparagraph.md +201 -0
  160. package/content/display-blocks/statistic.md +485 -0
  161. package/content/display-blocks/steps.md +585 -0
  162. package/content/display-blocks/tag.md +620 -0
  163. package/content/display-blocks/title.md +654 -0
  164. package/content/display-blocks/tour.md +2359 -0
  165. package/content/input-blocks/autocomplete.md +786 -0
  166. package/content/input-blocks/buttonselector.md +964 -0
  167. package/content/input-blocks/checkboxselector.md +765 -0
  168. package/content/input-blocks/checkboxswitch.md +497 -0
  169. package/content/input-blocks/colorselector.md +884 -0
  170. package/content/input-blocks/daterangeselector.md +777 -0
  171. package/content/input-blocks/dateselector.md +693 -0
  172. package/content/input-blocks/datetimeselector.md +791 -0
  173. package/content/input-blocks/inputgallery.md +528 -0
  174. package/content/input-blocks/monthselector.md +717 -0
  175. package/content/input-blocks/multipleselector.md +1337 -0
  176. package/content/input-blocks/numberinput.md +855 -0
  177. package/content/input-blocks/pagination.md +679 -0
  178. package/content/input-blocks/paragraphinput.md +1664 -0
  179. package/content/input-blocks/passwordinput.md +480 -0
  180. package/content/input-blocks/phonenumberinput.md +688 -0
  181. package/content/input-blocks/radioselector.md +820 -0
  182. package/content/input-blocks/ratingslider.md +684 -0
  183. package/content/input-blocks/s3uploadbutton.md +384 -0
  184. package/content/input-blocks/s3uploaddragger.md +305 -0
  185. package/content/input-blocks/s3uploadphoto.md +288 -0
  186. package/content/input-blocks/segmentedselector.md +782 -0
  187. package/content/input-blocks/selector.md +1162 -0
  188. package/content/input-blocks/switch.md +552 -0
  189. package/content/input-blocks/textarea.md +714 -0
  190. package/content/input-blocks/textinput.md +639 -0
  191. package/content/input-blocks/tiptapinput.md +226 -0
  192. package/content/input-blocks/tiptapmentioninput.md +471 -0
  193. package/content/input-blocks/titleinput.md +1094 -0
  194. package/content/input-blocks/treeinput.md +144 -0
  195. package/content/input-blocks/treemultipleselector.md +162 -0
  196. package/content/input-blocks/treeselector.md +185 -0
  197. package/content/input-blocks/upload.md +149 -0
  198. package/content/input-blocks/uploaddragger.md +85 -0
  199. package/content/input-blocks/uploadphoto.md +84 -0
  200. package/content/input-blocks/weekselector.md +630 -0
  201. package/content/list-blocks/controlledlist.md +498 -0
  202. package/content/list-blocks/list.md +529 -0
  203. package/content/list-blocks/listselector.md +301 -0
  204. package/content/list-blocks/masonrylist.md +230 -0
  205. package/content/migration/upgrade-guide.md +106 -0
  206. package/content/migration/v4-to-v5.md +589 -0
  207. package/content/migration/v5-to-v6.md +36 -0
  208. package/content/operators/_actions.md +58 -0
  209. package/content/operators/_and.md +76 -0
  210. package/content/operators/_api.md +254 -0
  211. package/content/operators/_app.md +114 -0
  212. package/content/operators/_args.md +65 -0
  213. package/content/operators/_array.md +331 -0
  214. package/content/operators/_base64.md +49 -0
  215. package/content/operators/_boolean.md +33 -0
  216. package/content/operators/_build.md +166 -0
  217. package/content/operators/_change_case.md +357 -0
  218. package/content/operators/_date.md +415 -0
  219. package/content/operators/_dayjs.md +128 -0
  220. package/content/operators/_diff.md +61 -0
  221. package/content/operators/_divide.md +32 -0
  222. package/content/operators/_eq.md +52 -0
  223. package/content/operators/_event.md +86 -0
  224. package/content/operators/_function.md +52 -0
  225. package/content/operators/_get.md +92 -0
  226. package/content/operators/_global.md +86 -0
  227. package/content/operators/_gt.md +50 -0
  228. package/content/operators/_gte.md +50 -0
  229. package/content/operators/_hash.md +112 -0
  230. package/content/operators/_if.md +30 -0
  231. package/content/operators/_if_none.md +47 -0
  232. package/content/operators/_index.md +48 -0
  233. package/content/operators/_input.md +86 -0
  234. package/content/operators/_intl.md +135 -0
  235. package/content/operators/_item.md +166 -0
  236. package/content/operators/_js.md +113 -0
  237. package/content/operators/_json.md +120 -0
  238. package/content/operators/_jsonata.md +152 -0
  239. package/content/operators/_locale.md +65 -0
  240. package/content/operators/_location.md +40 -0
  241. package/content/operators/_log.md +22 -0
  242. package/content/operators/_lt.md +50 -0
  243. package/content/operators/_lte.md +50 -0
  244. package/content/operators/_math.md +407 -0
  245. package/content/operators/_media.md +83 -0
  246. package/content/operators/_menu.md +62 -0
  247. package/content/operators/_module.md +340 -0
  248. package/content/operators/_mql.md +95 -0
  249. package/content/operators/_ne.md +62 -0
  250. package/content/operators/_not.md +33 -0
  251. package/content/operators/_number.md +159 -0
  252. package/content/operators/_nunjucks.md +117 -0
  253. package/content/operators/_object.md +253 -0
  254. package/content/operators/_operator.md +33 -0
  255. package/content/operators/_or.md +67 -0
  256. package/content/operators/_product.md +45 -0
  257. package/content/operators/_random.md +90 -0
  258. package/content/operators/_ref.md +80 -0
  259. package/content/operators/_regex.md +69 -0
  260. package/content/operators/_request.md +35 -0
  261. package/content/operators/_request_details.md +29 -0
  262. package/content/operators/_secret.md +56 -0
  263. package/content/operators/_state.md +134 -0
  264. package/content/operators/_step.md +98 -0
  265. package/content/operators/_string.md +327 -0
  266. package/content/operators/_subtract.md +24 -0
  267. package/content/operators/_sum.md +45 -0
  268. package/content/operators/_switch.md +37 -0
  269. package/content/operators/_t.md +96 -0
  270. package/content/operators/_theme.md +65 -0
  271. package/content/operators/_type.md +78 -0
  272. package/content/operators/_uri.md +49 -0
  273. package/content/operators/_url_query.md +92 -0
  274. package/content/operators/_user.md +154 -0
  275. package/content/operators/_uuid.md +118 -0
  276. package/content/operators/_var.md +88 -0
  277. package/content/operators/_yaml.md +96 -0
  278. package/content/other/introduction.md +39 -0
  279. package/content/other/next-auth-providers.md +3 -0
  280. package/content/other/updatesession.md +26 -0
  281. package/content/plugins/plugins-actions.md +80 -0
  282. package/content/plugins/plugins-connections.md +98 -0
  283. package/content/plugins/plugins-dev.md +138 -0
  284. package/content/plugins/plugins-introduction.md +29 -0
  285. package/content/plugins/plugins-operators.md +71 -0
  286. package/content/testing/e2e-auth.md +108 -0
  287. package/content/testing/e2e-configuration.md +107 -0
  288. package/content/testing/e2e-getting-started.md +96 -0
  289. package/content/testing/e2e-introduction.md +53 -0
  290. package/content/testing/e2e-mocking.md +155 -0
  291. package/content/testing/e2e-writing-tests.md +214 -0
  292. package/content/tutorial/tutorial-actions-operators.md +222 -0
  293. package/content/tutorial/tutorial-add-blocks.md +86 -0
  294. package/content/tutorial/tutorial-create-page.md +57 -0
  295. package/content/tutorial/tutorial-display-data-page.md +181 -0
  296. package/content/tutorial/tutorial-next-steps.md +53 -0
  297. package/content/tutorial/tutorial-requests-sql.md +22 -0
  298. package/content/tutorial/tutorial-start.md +71 -0
  299. package/content/user-authentication/auth-providers.md +15 -0
  300. package/content/user-authentication/login-and-logout.md +122 -0
  301. package/content/user-authentication/users-introduction.md +31 -0
  302. package/index.json +2281 -0
  303. package/package.json +34 -0
  304. package/scripts/extractAgentDocs.js +130 -0
@@ -0,0 +1,739 @@
1
+ # MongoDB
2
+
3
+ MongoDB is a NoSQL database that stores JSON-like documents. These documents are stored in collections, which are like database tables. The fields inside these document can differ from document to document, but generally they are all more or less the same. However documents with different schemas can be stored in the same collection.
4
+
5
+ ##### ObjectIds
6
+
7
+ MongoDB uses the _id field as the id for a document. This has to be unique for every document in the collection. If no _id is provided when the document is created, a MongoDB [ObjectId](https://docs.mongodb.com/manual/reference/method/ObjectId/) is created for that document. This id includes a timestamp, a random element and an incrementing counter, to ensure it is unique even if multiple ids are created at the same time.
8
+
9
+ The _id is often represented as:
10
+
11
+ ```js
12
+ {
13
+ _id: ObjectId("507f1f77bcf86cd799439011")
14
+ }
15
+ ```
16
+
17
+ To be able to transmit these ids over JSON network connections, and to use them in Lowdefy apps, Lowdefy serializes these ids as (in YAML):
18
+ ```yaml
19
+ _id:
20
+ _oid: 507f1f77bcf86cd799439011
21
+ ```
22
+
23
+ Ids specified in this way will be treated as ObjectIds by MongoDB requests and mutations.
24
+
25
+
26
+ ## Connections
27
+
28
+ Connection types:
29
+ - MongoDBCollection
30
+
31
+ ### MongoDBCollection
32
+
33
+ The `MongoDBCollection` connection sets up a connection to a MongoDB deployment. A [connection URI](https://docs.mongodb.com/manual/reference/connection-string/index.html) with authentication credentials (username and password) is required. The URI can be in the standard or dns seedlist (srv) formats. Connections are defined on a collection level, since this allows for read/write access control on a per collection level. Access control can also be managed using the roles in the database.
34
+
35
+ >Since the connection URI contains authentication secrets, it should be stored using the [`_secret`](operators/secret.md) operator.
36
+
37
+ When using MongoDBUpdateOne and MongoDBDeleteOne requests, take note that the responses differ if the connection has a log collection.
38
+
39
+ #### Properties
40
+ - `databaseUri: string`: __Required__ - Connection uri string for the MongoDb deployment. Should be stored using the [_secret](operators/secret.md) operator.
41
+ - `databaseName: string`: Default: Database specified in connection string - The name of the database in the MongoDB deployment.
42
+ - `collection: string`: __Required__ - The name of the MongoDB collection.
43
+ - `read: boolean`: Default: `true` - Allow read operations like find on the collection.
44
+ - `write: boolean`: Default: `false` - Allow write operations like update on the collection.
45
+ - `options: object`: See the [driver documentation](https://mongodb.github.io/node-mongodb-native/4.0/interfaces/mongoclientoptions.html) for more information.
46
+
47
+ #### Examples
48
+
49
+ ###### MongoDB collection with reads and writes:
50
+ ```yaml
51
+ connections:
52
+ - id: my_collection
53
+ type: MongoDBCollection
54
+ properties:
55
+ databaseUri:
56
+ _secret: MONGODB_URI
57
+ collection: my_collection_name
58
+ write: true
59
+ ```
60
+ ###### MongoDB collection with reads, writes and a log collection:
61
+ ```yaml
62
+ connections:
63
+ - id: my_collection
64
+ type: MongoDBCollection
65
+ properties:
66
+ databaseUri:
67
+ _secret: MONGODB_URI
68
+ collection: my_collection_name
69
+ write: true
70
+ changeLog:
71
+ collection: log_collection_name
72
+ meta:
73
+ user:
74
+ _user: true
75
+ ```
76
+ Environment variables:
77
+ ```
78
+ LOWDEFY_SECRET_MONGODB_URI = mongodb+srv://username:password@server.example.com/database
79
+ ```
80
+
81
+ ## Requests
82
+
83
+ Request types:
84
+ - MongoDBAggregation
85
+ - MongoDBBulkWrite
86
+ - MongoDBDeleteMany
87
+ - MongoDBDeleteOne
88
+ - MongoDBFind
89
+ - MongoDBFindOne
90
+ - MongoDBInsertMany
91
+ - MongoDBInsertOne
92
+ - MongoDBUpdateMany
93
+ - MongoDBUpdateOne
94
+
95
+
96
+ ### MongoDBAggregation
97
+
98
+ The `MongoDBAggregation` request executes an [aggregation pipeline](https://docs.mongodb.com/manual/core/aggregation-pipeline/) in the collection specified in the connectionId. It returns the array of documents returned by the aggregation. Aggregation pipelines are MongoDB's data processing and aggregation framework. They are based on a series of stages, each of which apply a transformation to the data passed through them, like sorting, grouping or calculating additional fields.
99
+
100
+ >Cursors are not supported. The request will return the whole body of the response as an array.
101
+
102
+ #### Properties
103
+ - `pipeline: object[]`: __Required__ - Array containing all the aggregation framework commands for the execution.
104
+ - `options: object`: Optional settings. See the [driver documentation](https://mongodb.github.io/node-mongodb-native/4.0/classes/collection.html#aggregate) for more information. Supported settings are:
105
+ - `allowDiskUse: boolean`: Default: `false` - Allow disk use on the MongoDB server to store temporary results for the aggregation.
106
+ - `authdb: string`: Specifies the authentication information to be used.
107
+ - `batchSize: number`: The number of documents to return per batch.
108
+ - `bsonRegExp: boolean`: Return the BSON regular expressions as BSONRegExp instances.
109
+ - `bypassDocumentValidation: boolean`: Default: `false` - Allow driver to bypass schema validation in MongoDB 3.2 or higher.
110
+ - `checkKeys: boolean`: The serializer will check if keys are valid.
111
+ - `collation: object`: Specify collation (MongoDB 3.4 or higher) settings for update operation.
112
+ - `comment: string`: Add a [comment](https://docs.mongodb.com/manual/reference/operator/query/comment/index.html) to the aggregation. These comments are visible in the MongoDB profile log, making them easier to interpret.
113
+ - `dbName: string`: The database name.
114
+ - `explain: boolean`: Specifies to return the information on the processing of the pipeline.
115
+ - `fullResponse: boolean`: Return the full server response for the command.
116
+ - `hint: string | object`: Add an index selection hint to an aggregation command.
117
+ - `ignoreUndefined: boolean`: Default: `true` - Serialize will not emit undefined fields.
118
+ - `let: object`: Specifies an object with a list of variables. This allows you to improve command readability by separating the variables from the query text.
119
+ - `maxAwaitTimeMS: number`: The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query.
120
+ - `maxTimeMS: number`: Specifies a cumulative time limit in milliseconds for processing operations on the cursor.
121
+ - `noResponse: boolean`: Admin command option.
122
+ - `readConcern: object`: Specifies the level of isolation for read operations.
123
+ - `readPreference: string | object`: The read preference.
124
+ - `retryWrites: boolean`: Should retry failed writes.
125
+ - `serializeFunctions: boolean`: Default: `false` - Serialize the javascript functions.
126
+ - `willRetryWrites: boolean`: Option whether to retry writes.
127
+ - `writeConcern: object`: An object that expresses the write concern to use with the $out or $merge stage.
128
+
129
+ #### Examples
130
+
131
+ ###### Calculate average score by region:
132
+ ```yaml
133
+ requests:
134
+ - id: avg_spend_by_region
135
+ type: MongoDBAggregation
136
+ connectionId: my_mongodb_collection_id
137
+ properties:
138
+ pipeline:
139
+ - $group:
140
+ _id: $region
141
+ score:
142
+ $avg: $score
143
+ - $project:
144
+ _id: 0
145
+ region: $_id
146
+ score: 1
147
+ - $sort:
148
+ score: 1
149
+ ```
150
+
151
+ ### MongoDBBulkWrite
152
+
153
+ The `MongoDBBulkWrite` request executes [bulkWrite operations](https://www.mongodb.com/docs/manual/reference/method/db.collection.bulkWrite/#write-operations) in the collection specified in the connectionId.
154
+
155
+ #### Properties
156
+ - `operations: object[]`: __Required__ - Array containing all the bulkWrite operations for the execution.
157
+ - `insertOne: object`:
158
+ - `document: object`: The document to be inserted.
159
+ - `deleteOne: object`:
160
+ - `filter: object`: __Required__ - The filter used to select the document to delete.
161
+ - `collation: object`: Specify collation settings for update operation.
162
+ - `deleteMany: object`:
163
+ - `filter: object`: __Required__ - The filter used to select the documents to delete.
164
+ - `collation: object`: Specify collation settings for update operation.
165
+ - `updateOne: object`:
166
+ - `filter: object`: __Required__ - The filter used to select the document to update.
167
+ - `update: object | object[]`: __Required__ - The update operations to be applied to the document.
168
+ - `upsert: object`: Insert document if no match is found.
169
+ - `arrayFilters: string[]`: Array filters for the [`$[<identifier>]`](https://docs.mongodb.com/manual/reference/operator/update/positional-filtered/) array update operator.
170
+ - `collation: object`: Specify collation settings for update operation.
171
+ - `hint: object | string`: 'An optional hint for query optimization.'
172
+ - `updateMany: object`:
173
+ - `filter: object`: __Required__ - The filter used to select the documents to update.
174
+ - `update: object | object[]`: __Required__ - The update operations to be applied to the documents.
175
+ - `upsert: object`: Insert document if no match is found.
176
+ - `arrayFilters: string[]`: Array filters for the [`$[<identifier>]`](https://docs.mongodb.com/manual/reference/operator/update/positional-filtered/) array update operator.
177
+ - `collation: object`: Specify collation settings for update operation.
178
+ - `hint: object | string`: An optional hint for query optimization.
179
+ - `replaceOne: object`:
180
+ - `filter: object`: __Required__ - The filter used to select the document to replace.
181
+ - `replacement: object`: __Required__ - The document to be inserted.
182
+ - `upsert: object`: Insert document if no match is found.
183
+ - `collation: object`: Specify collation settings for update operation.
184
+ - `hint: object | string`: An optional hint for query optimization.
185
+ - `options: object`: Optional settings. See the [driver documentation](https://mongodb.github.io/node-mongodb-native/4.0/classes/collection.html#aggregate) for more information. Supported settings are:
186
+ - `ordered: boolean`: Default: `true` - A boolean specifying whether the mongod instance should perform an ordered or unordered operation execution.
187
+ - `writeConcern: object`: An object that expresses the write concern to use.
188
+
189
+ #### Examples
190
+
191
+ ###### Update pizzas:
192
+
193
+ ```yaml
194
+ requests:
195
+ - id: update_pizzas
196
+ type: MongoDBBulkWrite
197
+ connectionId: my_mongodb_collection_id
198
+ properties:
199
+ operations:
200
+ - insertOne:
201
+ document:
202
+ _id: 3
203
+ type: "beef"
204
+ size: "medium"
205
+ price: 6
206
+ - insertOne:
207
+ document:
208
+ _id: 4
209
+ type: "sausage"
210
+ size: "large"
211
+ price: 10
212
+ - updateOne:
213
+ filter:
214
+ type: "cheese"
215
+ update:
216
+ $set:
217
+ price: 8
218
+ - deleteOne:
219
+ filter:
220
+ type: "pepperoni"
221
+ - replaceOne:
222
+ filter:
223
+ type: "vegan"
224
+ replacement:
225
+ type: "tofu"
226
+ size: "small"
227
+ price: 4
228
+ ```
229
+
230
+ ### MongoDBDeleteMany
231
+
232
+ The `MongoDBDeleteMany` request deletes multiple documents in the collection specified in the connectionId. It requires a filter, which is written in the query syntax, to select a documents to delete.
233
+
234
+ #### Properties
235
+ - `filter: object`: __Required__ - The filter used to select the document to update.
236
+ - `options: object`: Optional settings. See the [driver documentation](https://mongodb.github.io/node-mongodb-native/4.0/classes/collection.html#deletemany) for more information. Supported settings are:
237
+ - `authdb: string`: Specifies the authentication information to be used.
238
+ - `bsonRegExp: boolean`: Return the BSON regular expressions as BSONRegExp instances.
239
+ - `checkKeys: boolean`: Default: `false` - If true, will throw if bson documents start with $ or include a . in any key value.
240
+ - `collation: object`: Specify collation (MongoDB 3.4 or higher) settings for update operation.
241
+ - `comment: string`: A user-provided comment to attach to this command.
242
+ - `dbName: string`: The database name.
243
+ - `explain: boolean`: Specifies the verbosity mode for the explain output.
244
+ - `fullResponse: boolean`: Return the full server response for the command.
245
+ - `hint: string | object`: An optional hint for query optimization.
246
+ - `ignoreUndefined: boolean`: Default: `false` - Specify if the BSON serializer should ignore undefined fields.
247
+ - `let: object`: Map of parameter names and values that can be accessed using `$$var` (requires MongoDB 5.0).
248
+ - `maxTimeMS: number`: Specifies a cumulative time limit in milliseconds for processing operations on the cursor.
249
+ - `noResponse: boolean`: Admin command option.
250
+ - `ordered: boolean`: If true, when an insert fails, don't execute the remaining writes. If false, continue with remaining inserts when one fails.
251
+ - `readConcern: object`: Specify a read concern and level for the collection. (only MongoDB 3.2 or higher supported).
252
+ - `readPreference: string | object`: The read preference.
253
+ - `retryWrites: boolean`: Should retry failed writes.
254
+ - `serializeFunctions: boolean`: Default: `false` - Serialize the javascript functions.
255
+ - `willRetryWrites: boolean`: Option whether to retry writes.
256
+ - `writeConcern: object`: An object that expresses the write concern.
257
+
258
+ #### Examples
259
+
260
+ ###### Delete all documents older than a specific date:
261
+ ```yaml
262
+ requests:
263
+ - id: delete_old_documents
264
+ type: MongoDBDeleteMany
265
+ connectionId: my_mongodb_collection_id
266
+ properties:
267
+ filter:
268
+ created_date:
269
+ $lt:
270
+ _date: 2020-01-01
271
+ ```
272
+
273
+ ### MongoDBDeleteOne
274
+
275
+ The `MongoDBDeleteOne` request deletes a single document in the collection specified in the connectionId. It requires a filter, which is written in the query syntax, to select a document to delete. It will delete the first document that matches the filter.
276
+ > MongoDBDeleteOne response differs when the connection has a log collection. When a log collection is set on the connection, a findOneAndDelete operation is performed compared to the standard deleteOne operation.
277
+
278
+ #### Properties
279
+ - `filter: object`: __Required__ - The filter used to select the document to update.
280
+ - `options: object`: Optional settings. See the [driver documentation](https://mongodb.github.io/node-mongodb-native/4.0/classes/collection.html#deleteone) for more information. Supported settings are:
281
+ - `authdb: string`: Specifies the authentication information to be used.
282
+ - `bsonRegExp: boolean`: Return the BSON regular expressions as BSONRegExp instances.
283
+ - `checkKeys: boolean`: Default: `false` - If true, will throw if bson documents start with $ or include a . in any key value.
284
+ - `collation: object`: Specify collation (MongoDB 3.4 or higher) settings for update operation.
285
+ - `comment: string`: A user-provided comment to attach to this command.
286
+ - `dbName: string`: The database name.
287
+ - `explain: boolean`: Specifies the verbosity mode for the explain output.
288
+ - `fullResponse: boolean`: Return the full server response for the command.
289
+ - `hint: string | object`: An optional hint for query optimization.
290
+ - `ignoreUndefined: boolean`: Default: `false` - Specify if the BSON serializer should ignore undefined fields.
291
+ - `let: object`: Map of parameter names and values that can be accessed using `$$var` (requires MongoDB 5.0).
292
+ - `maxTimeMS: number`: Specifies a cumulative time limit in milliseconds for processing operations on the cursor.
293
+ - `noResponse: boolean`: Admin command option.
294
+ - `ordered: boolean`: If true, when an insert fails, don't execute the remaining writes. If false, continue with remaining inserts when one fails.
295
+ - `readConcern: object`: Specify a read concern and level for the collection. (only MongoDB 3.2 or higher supported).
296
+ - `readPreference: string | object`: The read preference.
297
+ - `retryWrites: boolean`: Should retry failed writes.
298
+ - `serializeFunctions: boolean`: Default: `false` - Serialize the javascript functions.
299
+ - `willRetryWrites: boolean`: Option whether to retry writes.
300
+ - `writeConcern: object`: An object that expresses the write concern.
301
+
302
+ #### Examples
303
+
304
+ ###### Delete a document by _id:
305
+ ```yaml
306
+ requests:
307
+ - id: delete_selected_document
308
+ type: MongoDBDeleteOne
309
+ connectionId: my_mongodb_collection_id
310
+ payload:
311
+ selected_id
312
+ _state: selected_id
313
+ properties:
314
+ filter:
315
+ _id:
316
+ _payload: selected_id
317
+ ```
318
+
319
+ ### MongoDBFind
320
+
321
+ The `MongoDBFind` request executes a MongoDB [query](https://docs.mongodb.com/manual/tutorial/query-documents/) on the collection specified in the connectionId. It returns the array of documents returned by the query.
322
+
323
+ >Cursors are not supported. The request will return the whole body of the response as an array.
324
+
325
+ #### Properties
326
+ - `query: object`: __Required__ - A MongoDB query object.
327
+ - `options: object`: Optional settings. See the [driver documentation](https://mongodb.github.io/node-mongodb-native/4.0/classes/collection.html#find) for more information. Supported settings are:
328
+ - `allowDiskUse: boolean`: Allows disk use for blocking sort operations exceeding 100MB memory. (MongoDB 3.2 or higher)
329
+ - `allowPartialResults: boolean`: For queries against a sharded collection, allows the command (or subsequent getMore commands) to return partial results, rather than an error, if one or more queried shards are available.
330
+ - `authdb: string`: Specifies the authentication information to be used.
331
+ - `awaitData: boolean`: Specify if the cursor is a tailable-await cursor. Requires `tailable` to be true.
332
+ - `batchSize: number`: Set the batchSize for the getMoreCommand when iterating over the query results.
333
+ - `bsonRegExp: boolean`: Return the BSON regular expressions as BSONRegExp instances.
334
+ - `checkKeys: boolean`: The serializer will check if keys are valid.
335
+ - `collation: object`: Specify collation (MongoDB 3.4 or higher) settings for update operation.
336
+ - `comment: string | object`: Add a [comment](https://docs.mongodb.com/manual/reference/operator/query/comment/index.html) to the query. These comments are visible in the MongoDB profile log, making them easier to interpret.
337
+ - `dbName: string`: The database name.
338
+ - `explain: boolean`: Specifies the verbosity mode for the explain output.
339
+ - `fullResponse: boolean`: Return the full server response for the command.
340
+ - `hint: string | object`: Tell the query to use specific indexes in the query. Object of indexes to use, `{'_id':1}`.
341
+ - `ignoreUndefined: boolean`: Default: `true` - Serialize will not emit undefined fields.
342
+ - `let: object`: Map of parameter names and values that can be accessed using `$$var` (requires MongoDB 5.0).
343
+ - `limit: number`: Sets the limit of documents returned in the query.
344
+ - `max: object`: The exclusive upper bound for a specific index.
345
+ - `maxAwaitTimeMS: number`: The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. Requires `tailable` and `awaitData` to be true.
346
+ - `maxTimeMS: number`: Number of milliseconds to wait before aborting the command.
347
+ - `min: object`: The inclusive lower bound for a specific index.
348
+ - `noCursorTimeout: boolean`: The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use. Set this option to prevent that.
349
+ - `noResponse: boolean`: Admin command option.
350
+ - `projection: object`: The fields to return in the query. Object of fields to either include or exclude (one of, not both), `{'a':1, 'b': 1}` or `{'a': 0, 'b': 0}`.
351
+ - `readConcern: object`: Specify a read concern and level for the collection. (only MongoDB 3.2 or higher supported).
352
+ - `readPreference: string | object`: The preferred read preference.
353
+ - `retryWrites: boolean`: Should retry failed writes.
354
+ - `returnKey: boolean`: If true, returns only the index keys in the resulting documents.
355
+ - `serializeFunctions: boolean`: Default: `false` - Serialize the javascript functions.
356
+ - `showRecordId: boolean`: Determine whether to return the record identifier for each document. If true, adds a field $recordId to the returned documents.
357
+ - `singleBatch: boolean`: Default: `false` - Determines whether to close the cursor after the first batch.
358
+ - `skip: number`: Set to skip N documents ahead in your query (useful for pagination).
359
+ - `sort: array | object`: Set to sort the documents coming back from the query.
360
+ - `tailable: boolean`: Specify if the cursor is tailable.
361
+ - `timeout: boolean`: Specify if the cursor can timeout.
362
+ - `willRetryWrites: boolean`: Option whether to retry writes.
363
+ - `writeConcern: object`: An object that expresses the write concern.
364
+
365
+ #### Examples
366
+
367
+ ###### Find top ten scores above 90:
368
+ ```yaml
369
+ requests:
370
+ - id: scores_top_ten_scores_above_90
371
+ type: MongoDBFind
372
+ connectionId: my_mongodb_collection_id
373
+ properties:
374
+ query:
375
+ score:
376
+ $gt: 90
377
+ options:
378
+ sort:
379
+ - - score
380
+ - -1
381
+ limit: 10
382
+ projection:
383
+ score: 1
384
+ name: 1
385
+ ```
386
+
387
+ ### MongoDBFindOne
388
+
389
+ The `MongoDBFindOne` request executes a MongoDB [query](https://docs.mongodb.com/manual/tutorial/query-documents/) on the collection specified in the connectionId. It returns the first document that matches the specified query.
390
+
391
+ >Cursors are not supported. The request will return the whole body of the response as an array.
392
+
393
+ #### Properties
394
+ - `query: object`: __Required__ - A MongoDB query object.
395
+ - `options: object`: Optional settings. See the [driver documentation](https://mongodb.github.io/node-mongodb-native/4.0/classes/collection.html#findone) for more information. Supported settings are:
396
+ - `allowDiskUse: boolean`: Allows disk use for blocking sort operations exceeding 100MB memory. (MongoDB 3.2 or higher)
397
+ - `allowPartialResults: boolean`: For queries against a sharded collection, allows the command (or subsequent getMore commands) to return partial results, rather than an error, if one or more queried shards are available.
398
+ - `authdb: string`: Specifies the authentication information to be used.
399
+ - `awaitData: boolean`: Specify if the cursor is a tailable-await cursor. Requires `tailable` to be true.
400
+ - `batchSize: number`: Set the batchSize for the getMoreCommand when iterating over the query results.
401
+ - `bsonRegExp: boolean`: Return the BSON regular expressions as BSONRegExp instances.
402
+ - `checkKeys: boolean`: The serializer will check if keys are valid.
403
+ - `collation: object`: Specify collation (MongoDB 3.4 or higher) settings for update operation.
404
+ - `comment: string | object`: Add a [comment](https://docs.mongodb.com/manual/reference/operator/query/comment/index.html) to the query. These comments are visible in the MongoDB profile log, making them easier to interpret.
405
+ - `dbName: string`: The database name.
406
+ - `explain: boolean`: Specifies the verbosity mode for the explain output.
407
+ - `fullResponse: boolean`: Return the full server response for the command.
408
+ - `hint: string | object`: Tell the query to use specific indexes in the query. Object of indexes to use, `{'_id':1}`.
409
+ - `ignoreUndefined: boolean`: Default: `true` - Serialize will not emit undefined fields.
410
+ - `let: object`: Map of parameter names and values that can be accessed using `$$var` (requires MongoDB 5.0).
411
+ - `limit: number`: Sets the limit of documents returned in the query.
412
+ - `max: object`: The exclusive upper bound for a specific index.
413
+ - `maxAwaitTimeMS: number`: The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. Requires `tailable` and `awaitData` to be true.
414
+ - `maxTimeMS: number`: Number of milliseconds to wait before aborting the command.
415
+ - `min: object`: The inclusive lower bound for a specific index.
416
+ - `noCursorTimeout: boolean`: The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use. Set this option to prevent that.
417
+ - `noResponse: boolean`: Admin command option.
418
+ - `projection: object`: The fields to return in the query. Object of fields to either include or exclude (one of, not both), `{'a':1, 'b': 1}` or `{'a': 0, 'b': 0}`.
419
+ - `readConcern: object`: Specify a read concern and level for the collection. (only MongoDB 3.2 or higher supported).
420
+ - `readPreference: string | object`: The preferred read preference.
421
+ - `retryWrites: boolean`: Should retry failed writes.
422
+ - `returnKey: boolean`: If true, returns only the index keys in the resulting documents.
423
+ - `serializeFunctions: boolean`: Default: `false` - Serialize the javascript functions.
424
+ - `showRecordId: boolean`: Determine whether to return the record identifier for each document. If true, adds a field $recordId to the returned documents.
425
+ - `singleBatch: boolean`: Default: `false` - Determines whether to close the cursor after the first batch.
426
+ - `skip: number`: Set to skip N documents ahead in your query (useful for pagination).
427
+ - `sort: array | object`: Set to sort the documents coming back from the query.
428
+ - `tailable: boolean`: Specify if the cursor is tailable.
429
+ - `timeout: boolean`: Specify if the cursor can timeout.
430
+ - `willRetryWrites: boolean`: Option whether to retry writes.
431
+ - `writeConcern: object`: An object that expresses the write concern.
432
+
433
+ #### Examples
434
+
435
+ ###### Find a document by id:
436
+ ```yaml
437
+ requests:
438
+ - id: find_by_id
439
+ type: MongoDBFindOne
440
+ connectionId: my_mongodb_collection_id
441
+ payload:
442
+ _id:
443
+ _input: _id
444
+ properties:
445
+ query:
446
+ _id:
447
+ _payload: _id
448
+ ```
449
+
450
+ ### MongoDBInsertMany
451
+
452
+ The `MongoDBInsertMany` request inserts an array of documents into the collection specified in the connectionId. If a `_id` field is not specified on a document, a MongoDB `ObjectID` will be generated.
453
+
454
+ #### Properties
455
+ - `docs: object[]`: __Required__ - The array of documents to be inserted.
456
+ - `options: object`: Optional settings. See the [driver documentation](https://mongodb.github.io/node-mongodb-native/4.0/classes/collection.html#insertmany) for more information. Supported settings are:
457
+ - `authdb: string`: Specifies the authentication information to be used.
458
+ - `bsonRegExp: boolean`: Return the BSON regular expressions as BSONRegExp instances.
459
+ - `bypassDocumentValidation: boolean`: Default: `false` - Allow driver to bypass schema validation in MongoDB 3.2 or higher
460
+ - `checkKeys: boolean`: Default: `true` - If true, will throw if bson documents start with $ or include a . in any key value.
461
+ - `collation: object`: Specify collation (MongoDB 3.4 or higher) settings for update operation.
462
+ - `comment: string | object`: Add a [comment](https://docs.mongodb.com/manual/reference/operator/query/comment/index.html) to the query. These comments are visible in the MongoDB profile log, making them easier to interpret.
463
+ - `dbName: string`: The database name.
464
+ - `explain: object`: Specifies the verbosity mode for the explain output.
465
+ - `forcesServerObjectId: boolean`: Default: `false` - Force server to assign _id values instead of driver.
466
+ - `fullResponse: boolean`: Return the full server response for the command.
467
+ - `ignoreUndefined: boolean`: Default: `false` - Specify if the BSON serializer should ignore undefined fields.
468
+ - `maxTimeMS: number`: Number of milliseconds to wait before aborting the command.
469
+ - `noResponse: boolean`: Admin command option.
470
+ - `ordered: boolean`: If true, when an insert fails, don't execute the remaining writes. If false, continue with remaining inserts when one fails.
471
+ - `readConcern: object`: Specify a read concern and level for the collection. (only MongoDB 3.2 or higher supported).
472
+ - `readPreference: object`: The preferred read preference.
473
+ - `retryWrites: boolean`: Should retry failed writes.
474
+ - `serializeFunctions: boolean`: Default: `false` - Serialize the javascript functions.
475
+ - `willRetryWrites: boolean`: Option whether to retry writes.
476
+ - `writeConcern: object`: An object that expresses the write concern.
477
+
478
+ #### Examples
479
+
480
+ ###### Insert a set of documents:
481
+ ```yaml
482
+ requests:
483
+ - id: insert_documents
484
+ type: MongoDBInsertMany
485
+ connectionId: my_mongodb_collection_id
486
+ properties:
487
+ docs:
488
+ - _id: 1
489
+ value: 4
490
+ - _id: 2
491
+ value: 1
492
+ - _id: 3
493
+ value: 7
494
+
495
+ ```
496
+
497
+ ### MongoDBInsertOne
498
+
499
+ The `MongoDBInsertOne` request inserts a document into the collection specified in the connectionId. If a `_id` field is not specified, a MongoDB `ObjectID` will be generated.
500
+
501
+ #### Properties
502
+ - `doc: object`: __Required__ - The document to be inserted.
503
+ - `options: object`: Optional settings. See the [driver documentation](https://mongodb.github.io/node-mongodb-native/4.0/classes/collection.html#insertone) for more information. Supported settings are:
504
+ - `authdb: string`: Specifies the authentication information to be used.
505
+ - `bsonRegExp: boolean`: Return the BSON regular expressions as BSONRegExp instances.
506
+ - `bypassDocumentValidation: boolean`: Default: `false` - Allow driver to bypass schema validation in MongoDB 3.2 or higher
507
+ - `checkKeys: boolean`: Default: `true` - If true, will throw if bson documents start with $ or include a . in any key value.
508
+ - `collation: object`: Specify collation (MongoDB 3.4 or higher) settings for update operation.
509
+ - `comment: string | object`: Add a [comment](https://docs.mongodb.com/manual/reference/operator/query/comment/index.html) to the query. These comments are visible in the MongoDB profile log, making them easier to interpret.
510
+ - `dbName: string`: The database name.
511
+ - `explain: object`: Specifies the verbosity mode for the explain output.
512
+ - `forcesServerObjectId: boolean`: Default: `false` - Force server to assign _id values instead of driver.
513
+ - `fullResponse: boolean`: Return the full server response for the command.
514
+ - `ignoreUndefined: boolean`: Default: `false` - Specify if the BSON serializer should ignore undefined fields.
515
+ - `maxTimeMS: number`: Number of milliseconds to wait before aborting the command.
516
+ - `noResponse: boolean`: Admin command option.
517
+ - `readConcern: object`: Specify a read concern and level for the collection. (only MongoDB 3.2 or higher supported).
518
+ - `readPreference: object`: The preferred read preference.
519
+ - `retryWrites: boolean`: Should retry failed writes.
520
+ - `serializeFunctions: boolean`: Default: `false` - Serialize the javascript functions.
521
+ - `willRetryWrites: boolean`: Option whether to retry writes.
522
+ - `writeConcern: object`: An object that expresses the write concern.
523
+
524
+ #### Examples
525
+
526
+ ###### Insert a document:
527
+ ```yaml
528
+ requests:
529
+ - id: insert_new_comment
530
+ type: MongoDBInsertOne
531
+ connectionId: my_mongodb_collection_id
532
+ payload:
533
+ comment:
534
+ _state: comment_input
535
+ properties:
536
+ doc:
537
+ comment:
538
+ _payload: comment
539
+ user_id:
540
+ _user: id
541
+ timestamp:
542
+ _date: now
543
+ ```
544
+
545
+ ### MongoDBUpdateMany
546
+
547
+ The `MongoDBUpdateMany` request updates multiple documents that match a certain criteria in the collection specified in the connectionId. It requires a filter, which is written in the query syntax, to select the documents to update.
548
+
549
+ #### Properties
550
+ - `filter: object`: __Required__ - The filter used to select the document to update.
551
+ - `update: object | object[]`: __Required__ - The update operations to be applied to the document.
552
+ - `options: object`: Optional settings. See the [driver documentation](https://mongodb.github.io/node-mongodb-native/3.3/api/Collection.html#updateOne) for more information. Supported settings are:
553
+ - `arrayFilters: string[]`: Array filters for the [`$[<identifier>]`](https://docs.mongodb.com/manual/reference/operator/update/positional-filtered/) array update operator.
554
+ - `bypassDocumentValidation: boolean`: Default: `false` - Allow driver to bypass schema validation in MongoDB 3.2 or higher.
555
+ - `checkKeys: boolean`: Default: `false` - If true, will throw if bson documents start with $ or include a . in any key value.
556
+ - `collation: object`: Specify collation (MongoDB 3.4 or higher) settings for update operation.
557
+ - `forceServerObjectId: boolean`: Force server to assign _id values instead of driver.
558
+ - `hint: object`: An optional hint for query optimization.
559
+ - `ignoreUndefined: boolean`: Default: `false` - Specify if the BSON serializer should ignore undefined fields.
560
+ - `j: boolean`: Specify a journal write concern.
561
+ - `upsert: boolean`: Default: `false` - Insert document if no match is found.
562
+ - `w: number | string`: The write concern.
563
+ - `wtimeout: number`: The write concern timeout.
564
+
565
+ #### Examples
566
+
567
+ ###### Set a list of documents as resolved:
568
+ ```yaml
569
+ requests:
570
+ - id: set_resolved
571
+ type: MongoDBUpdateMany
572
+ connectionId: my_mongodb_collection_id
573
+ payload:
574
+ selected_issues_list:
575
+ _state: selected_issues_list
576
+ properties:
577
+ # Select all documents where the _id is in selected_issues_list in state
578
+ filter:
579
+ _id:
580
+ $in:
581
+ _payload: selected_issues_list
582
+ update:
583
+ $set:
584
+ resolved: true
585
+ ```
586
+
587
+ ###### Mark all documents with score less than 6 as urgent:
588
+ ```yaml
589
+ requests:
590
+ - id: set_resolved
591
+ type: MongoDBUpdateMany
592
+ properties:
593
+ filter:
594
+ score:
595
+ $lt: 6
596
+ update:
597
+ $set:
598
+ status: urgent
599
+ ```
600
+
601
+ ### MongoDBUpdateOne
602
+
603
+ The `MongoDBUpdateOne` request updates a single document in the collection specified in the connectionId. It requires a filter, which is written in the query syntax, to select a document to update. It will update the first document that matches the filter. If the `upsert` option is set to true, it will insert a new document if no document is found to update.
604
+ > MongoDBUpdateOne response differs when the connection has a log collection. When a log collection is set on the connection, a findOneAndUpdate operation is performed compared to the standard updateOne operation.
605
+
606
+ #### Properties
607
+ - `filter: object`: __Required__ - The filter used to select the document to update.
608
+ - `update: object | object[]`: __Required__ - The update operations to be applied to the document.
609
+ - `options: object`: Optional settings. See the [driver documentation](https://mongodb.github.io/node-mongodb-native/4.0/classes/collection.html#updateone) for more information. Supported settings are:
610
+ - `arrayFilters: object[]`: _Array_ - Array filters for the [`$[<identifier>]`](https://docs.mongodb.com/manual/reference/operator/update/positional-filtered/) array update operator.
611
+ - `authdb: string`: Specifies the authentication information to be used.
612
+ - `bsonRegExp: boolean`: Return the BSON regular expressions as BSONRegExp instances.
613
+ - `bypassDocumentValidation: boolean`: Default: `false` - Allow driver to bypass schema validation in MongoDB 3.2 or higher.
614
+ - `checkKeys: boolean`: Default: `false` - If true, will throw if bson documents start with $ or include a . in any key value.
615
+ - `collation: object`: Specify collation (MongoDB 3.4 or higher) settings for update operation.
616
+ - `comment: string | object`: A user-provided comment to attach to this command.
617
+ - `dbName: string`: The database name.
618
+ - `explain: object`: Specifies the verbosity mode for the explain output.
619
+ - `fullResponse: boolean`: Return the full server response for the command.
620
+ - `hint: string | object`: An optional hint for query optimization.
621
+ - `ignoreUndefined: boolean`: Default: `false` - Specify if the BSON serializer should ignore undefined fields.
622
+ - `let: object`: Map of parameter names and values that can be accessed using `$$var` (requires MongoDB 5.0).
623
+ - `maxTimeMS: number`: Number of milliseconds to wait before aborting the command.
624
+ - `noResponse: boolean`: Admin command option.
625
+ - `readConcern: object`: Specify a read concern and level for the collection. (only MongoDB 3.2 or higher supported).
626
+ - `readPreference: object`: The preferred read preference.
627
+ - `retryWrites: boolean`: Should retry failed writes.
628
+ - `serializeFunctions: boolean`: Default: `false` - Serialize the javascript functions.
629
+ - `upsert: boolean`: Default: `false` - Insert document if no match is found.
630
+ - `willRetryWrites: boolean`: Option whether to retry writes.
631
+ - `writeConcern: object`: An object that expresses the write concern.
632
+
633
+ #### Examples
634
+
635
+ ###### Update a document:
636
+ ```yaml
637
+ requests:
638
+ - id: update
639
+ type: MongoDBUpdateOne
640
+ connectionId: my_mongodb_collection_id
641
+ payload:
642
+ _id:
643
+ _state: _id
644
+ properties:
645
+ filter:
646
+ _id:
647
+ _payload: _id
648
+ update:
649
+ $set:
650
+ _state: true
651
+ ```
652
+
653
+ Like a comment:
654
+ ```yaml
655
+ requests:
656
+ - id: like_comment
657
+ type: MongoDBUpdateOne
658
+ connectionId: my_mongodb_collection_id
659
+ payload:
660
+ comment_id:
661
+ _state: comment._id
662
+ properties:
663
+ filter:
664
+ _id:
665
+ _payload: comment_id
666
+ update:
667
+ $inc:
668
+ likes: 1
669
+ $push:
670
+ liked_by:
671
+ _user.id:
672
+ $set:
673
+ last_liked:
674
+ _date: now
675
+ ```
676
+
677
+ ## Websockets
678
+
679
+ Websocket types:
680
+ - MongoDBChangeStream
681
+
682
+ ### MongoDBChangeStream
683
+
684
+ The `MongoDBChangeStream` [websocket](/websockets-introduction) opens a MongoDB [change stream](https://www.mongodb.com/docs/manual/changeStreams/) on the collection specified in the connection, and pushes every change event to subscribed pages in real time. The source starts when the first page subscribes and stops when the last one leaves — any number of subscribers share one change stream.
685
+
686
+ Properties are evaluated per subscription, so `_user` and `_payload` operators in the `pipeline` produce user-specific streams.
687
+
688
+ > Change streams require MongoDB to run as a replica set — they are not available on standalone deployments. MongoDB Atlas clusters support them out of the box.
689
+
690
+ #### Properties
691
+
692
+ - `pipeline: object[]`: An array of [aggregation pipeline stages](https://www.mongodb.com/docs/manual/changeStreams/#modify-change-stream-output) applied to the change stream, e.g. `$match` on `operationType` or `fullDocument` fields.
693
+ - `fullDocument: string`: The change stream [fullDocument](https://www.mongodb.com/docs/manual/reference/method/db.collection.watch/) option. Defaults to `updateLookup`, which includes the current document on update events.
694
+
695
+ #### Examples
696
+
697
+ ###### Refetch a table when the user's orders change:
698
+ ```yaml
699
+ websockets:
700
+ - id: order_updates
701
+ type: MongoDBChangeStream
702
+ connectionId: my_mongodb_collection_id
703
+ properties:
704
+ pipeline:
705
+ - $match:
706
+ operationType:
707
+ $in:
708
+ - insert
709
+ - update
710
+ fullDocument.owner_id:
711
+ _user: id
712
+
713
+ pages:
714
+ - id: orders
715
+ type: PageHeaderMenu
716
+ requests:
717
+ - id: get_orders
718
+ type: MongoDBFind
719
+ connectionId: my_mongodb_collection_id
720
+ properties:
721
+ query:
722
+ owner_id:
723
+ _user: id
724
+ subscriptions:
725
+ - websocketId: order_updates
726
+ events:
727
+ onMessage:
728
+ - id: refetch
729
+ type: Request
730
+ params: get_orders
731
+ blocks:
732
+ - id: orders_table
733
+ type: AgGridAlpine
734
+ properties:
735
+ rowData:
736
+ _request: get_orders
737
+ ```
738
+
739
+ The change event payload is available on `_event: messages` in `onMessage` and via the [`_websocket`](/websocket-subscriptions) operator — each message is the MongoDB change event, including `operationType`, `documentKey` and `fullDocument`.