@adobe/aio-cli-plugin-app-storage 1.3.0-pre.2026-03-09.sha-3e589242 → 1.6.1

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.
package/README.md CHANGED
@@ -27,219 +27,132 @@ $ aio app db --help
27
27
 
28
28
  # Commands
29
29
  <!-- commands -->
30
- ## State Storage Commands
31
- * [`aio app state delete [KEYS]`](#aio-app-state-delete-keys)
32
- * [`aio app state get KEY`](#aio-app-state-get-key)
33
- * [`aio app state list`](#aio-app-state-list)
34
- * [`aio app state put KEY VALUE`](#aio-app-state-put-key-value)
35
- * [`aio app state stats`](#aio-app-state-stats)
36
-
37
- ## Database Commands
38
- ### Collection Management
39
- * [`aio app db collection list`](#aio-app-db-collection-list)
30
+ * [`aio app add db`](#aio-app-add-db)
40
31
  * [`aio app db collection create COLLECTION`](#aio-app-db-collection-create-collection)
41
32
  * [`aio app db collection drop COLLECTION`](#aio-app-db-collection-drop-collection)
33
+ * [`aio app db collection list`](#aio-app-db-collection-list)
42
34
  * [`aio app db collection rename CURRENTNAME NEWNAME`](#aio-app-db-collection-rename-currentname-newname)
43
35
  * [`aio app db collection stats COLLECTION`](#aio-app-db-collection-stats-collection)
44
-
45
- ### Document Operations
46
- * [`aio app db document insert COLLECTION DOCUMENTS`](#aio-app-db-document-insert-collection-documents)
36
+ * [`aio app db delete`](#aio-app-db-delete)
37
+ * [`aio app db document count COLLECTION [QUERY]`](#aio-app-db-document-count-collection-query)
47
38
  * [`aio app db document delete COLLECTION FILTER`](#aio-app-db-document-delete-collection-filter)
48
39
  * [`aio app db document find COLLECTION FILTER`](#aio-app-db-document-find-collection-filter)
49
- * [`aio app db document update COLLECTION FILTER UPDATE`](#aio-app-db-document-update-collection-filter-update)
40
+ * [`aio app db document insert COLLECTION DOCUMENTS`](#aio-app-db-document-insert-collection-documents)
50
41
  * [`aio app db document replace COLLECTION FILTER REPLACEMENT`](#aio-app-db-document-replace-collection-filter-replacement)
51
- * [`aio app db document count COLLECTION`](#aio-app-db-document-count-collection)
52
-
53
- ### Index Management
42
+ * [`aio app db document update COLLECTION FILTER UPDATE`](#aio-app-db-document-update-collection-filter-update)
54
43
  * [`aio app db index create COLLECTION`](#aio-app-db-index-create-collection)
55
44
  * [`aio app db index drop COLLECTION INDEXNAME`](#aio-app-db-index-drop-collection-indexname)
56
45
  * [`aio app db index list COLLECTION`](#aio-app-db-index-list-collection)
57
-
58
- ### Database Management
46
+ * [`aio app db org stats`](#aio-app-db-org-stats)
59
47
  * [`aio app db ping`](#aio-app-db-ping)
60
48
  * [`aio app db provision`](#aio-app-db-provision)
61
- * [`aio app db delete`](#aio-app-db-delete)
62
- * [`aio app db status`](#aio-app-db-status)
63
49
  * [`aio app db stats`](#aio-app-db-stats)
64
- * [`aio app db org stats`](#aio-app-db-org-stats)
65
- * `aio app db show collections` - Alias for [`aio app db collection list`](#aio-app-db-collection-list)
66
-
67
- ## Other Commands
50
+ * [`aio app db status`](#aio-app-db-status)
51
+ * [`aio app state delete [KEYS]`](#aio-app-state-delete-keys)
52
+ * [`aio app state get KEY`](#aio-app-state-get-key)
53
+ * [`aio app state list`](#aio-app-state-list)
54
+ * [`aio app state put KEY VALUE`](#aio-app-state-put-key-value)
55
+ * [`aio app state stats`](#aio-app-state-stats)
68
56
  * [`aio help [COMMAND]`](#aio-help-command)
69
57
 
70
- # State Storage Commands
71
-
72
- ## `aio app state delete [KEYS]`
58
+ ## `aio app add db`
73
59
 
74
- Delete key-values
60
+ Provision a new database for your App Builder application
75
61
 
76
62
  ```
77
63
  USAGE
78
- $ aio app state delete [KEYS...] [--json] [--region amer|emea|apac|aus] [--match <value>] [--force]
79
-
80
- ARGUMENTS
81
- [KEYS...] keys to delete. Above 5 keys, you will be prompted for confirmation
64
+ $ aio app add db [--json] [--region <value>] [-y]
82
65
 
83
66
  FLAGS
84
- --force [use with caution!] force delete, no safety prompt
85
- --match=<value> [use with caution!] deletes ALL key-values matching the provided glob-like pattern
86
- --region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
87
- <options: amer|emea|apac|aus>
67
+ -y, --yes Skip confirmation prompt and provision automatically
88
68
 
89
69
  GLOBAL FLAGS
90
- --json Format output as json.
70
+ --json Format output as json.
71
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
72
+ database region set in 'app.config.yaml' takes precedence over all of these.
73
+ <options: amer|emea|apac|aus>
91
74
 
92
75
  DESCRIPTION
93
- Delete key-values
94
-
95
- ALIASES
96
- $ aio app state del
97
- $ aio app state remove
98
- $ aio app state rm
76
+ Provision a new database for your App Builder application
99
77
 
100
78
  EXAMPLES
101
- $ aio app state delete key
102
-
103
- $ aio app state delete key1 key2 key3
79
+ $ aio app add db
104
80
 
105
- $ aio app state delete --match 'gl*b'
81
+ $ aio app add db --region amer
106
82
 
107
- $ aio app state delete --match 'gl*b' --json
83
+ $ aio app add db --json
108
84
 
109
- $ aio app state delete --match 'be-carreful*' --force
85
+ $ aio app add db --yes
110
86
  ```
111
87
 
112
- ## `aio app state get KEY`
88
+ ## `aio app db collection create COLLECTION`
113
89
 
114
- Get a key-value
90
+ Create a new collection in the database
115
91
 
116
92
  ```
117
93
  USAGE
118
- $ aio app state get KEY [--json] [--region amer|emea|apac|aus]
94
+ $ aio app db collection create COLLECTION [--json] [--region <value>] [-v <value>]
119
95
 
120
96
  ARGUMENTS
121
- KEY State key
122
-
123
- FLAGS
124
- --region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
125
- <options: amer|emea|apac|aus>
126
-
127
- GLOBAL FLAGS
128
- --json Format output as json.
129
-
130
- DESCRIPTION
131
- Get a key-value
132
-
133
- EXAMPLES
134
- $ aio app state get key
135
-
136
- $ aio app state get key --json
137
-
138
- $ aio app state get key | wc -c
139
- ```
140
-
141
- ## `aio app state list`
142
-
143
- List key-values
144
-
145
- ```
146
- USAGE
147
- $ aio app state list [--json] [--region amer|emea|apac|aus] [-m <value>]
97
+ COLLECTION The name of the collection to create
148
98
 
149
99
  FLAGS
150
- -m, --match=<value> [default: *] Glob-like pattern to filter keys
151
- --region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
152
- <options: amer|emea|apac|aus>
100
+ -v, --validator=<value> JSON schema validator for document validation (JSON string)
153
101
 
154
102
  GLOBAL FLAGS
155
- --json Format output as json.
103
+ --json Format output as json.
104
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
105
+ database region set in 'app.config.yaml' takes precedence over all of these.
106
+ <options: amer|emea|apac|aus>
156
107
 
157
108
  DESCRIPTION
158
- List key-values
109
+ Create a new collection in the database
159
110
 
160
111
  ALIASES
161
- $ aio app state ls
112
+ $ aio app db col create
162
113
 
163
114
  EXAMPLES
164
- $ aio app state list
165
-
166
- $ aio app state list --match 'gl*b'
115
+ $ aio app db collection create users
167
116
 
168
- $ aio app state list --json
117
+ $ aio app db collection create inventory --validator '{"type": "object", "required": ["id", "quantity"]}' --json
169
118
 
170
- $ aio app state list | less
119
+ $ aio app db col create products --json
171
120
 
172
- $ aio app state list | wc -l
121
+ $ aio app db col create products --validator '{"type": "object", "properties": {"name": {"type": "string"}, "price": {"type": "number", "minimum": 0}}, "required": ["name", "price"]}'
173
122
  ```
174
123
 
175
- ## `aio app state put KEY VALUE`
124
+ ## `aio app db collection drop COLLECTION`
176
125
 
177
- Put a key-value
126
+ Drop a collection from the database
178
127
 
179
128
  ```
180
129
  USAGE
181
- $ aio app state put KEY VALUE [--json] [--region amer|emea|apac|aus] [-t <value>]
130
+ $ aio app db collection drop COLLECTION [--json] [--region <value>]
182
131
 
183
132
  ARGUMENTS
184
- KEY State key
185
- VALUE State value
186
-
187
- FLAGS
188
- -t, --ttl=<value> Time to live in seconds. Default is 86400 (24 hours), max is 31536000 (1 year).
189
- --region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
190
- <options: amer|emea|apac|aus>
133
+ COLLECTION The name of the collection to drop
191
134
 
192
135
  GLOBAL FLAGS
193
- --json Format output as json.
136
+ --json Format output as json.
137
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
138
+ database region set in 'app.config.yaml' takes precedence over all of these.
139
+ <options: amer|emea|apac|aus>
194
140
 
195
141
  DESCRIPTION
196
- Put a key-value
197
-
198
- EXAMPLES
199
- $ aio app state put key value
200
-
201
- $ aio app state put key value --ttl 3600
202
-
203
- $ aio app state put key value --json
204
-
205
- $ cat value/from/file | xargs -0 ./bin/run.js app state put key
206
- ```
207
-
208
- ## `aio app state stats`
209
-
210
- Display stats
211
-
212
- ```
213
- USAGE
214
- $ aio app state stats [--json] [--region amer|emea|apac|aus]
215
-
216
- FLAGS
217
- --region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
218
- <options: amer|emea|apac|aus>
219
-
220
- GLOBAL FLAGS
221
- --json Format output as json.
142
+ Drop a collection from the database
222
143
 
223
- DESCRIPTION
224
- Display stats
144
+ ALIASES
145
+ $ aio app db col drop
225
146
 
226
147
  EXAMPLES
227
- $ aio app state stats
228
-
229
- $ aio app state stats --json
230
- ```
231
-
232
- # Database Commands
233
-
234
- ## A Note on Regions
235
-
236
- > Note: All workspace databases have to be provisioned in a specific region, and all database commands must be executed in that same region. If set in the `app.config.yaml` application manifest, that region will be used. If not, it will first fall back to what is set in the --region flag, followed by the AIO_DB_REGION environment variable, and finally to the default `amer` region. See [Getting Started with Database Storage](https://developer.adobe.com/app-builder/docs/guides/app_builder_guides/storage/database) for more details.
148
+ $ aio app db collection drop users
237
149
 
238
- ## Collection Management
150
+ $ aio app db collection drop products --json
239
151
 
240
- > Note: The commands under `aio app db collection <command>` are also available as `aio app db col <command>` shorthand aliases.
152
+ $ aio app db col drop inventory
153
+ ```
241
154
 
242
- ### `aio app db collection list`
155
+ ## `aio app db collection list`
243
156
 
244
157
  Get the list of collections in your App Builder database
245
158
 
@@ -252,8 +165,8 @@ FLAGS
252
165
 
253
166
  GLOBAL FLAGS
254
167
  --json Format output as json.
255
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
256
- Any database region set in 'app.config.yaml' takes precedence over all of these.
168
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
169
+ database region set in 'app.config.yaml' takes precedence over all of these.
257
170
  <options: amer|emea|apac|aus>
258
171
 
259
172
  DESCRIPTION
@@ -273,74 +186,7 @@ EXAMPLES
273
186
  $ aio app db col list --info --json
274
187
  ```
275
188
 
276
- ### `aio app db collection create COLLECTION`
277
-
278
- Create a new collection in the database
279
-
280
- ```
281
- USAGE
282
- $ aio app db collection create COLLECTION [--json] [--region <value>] [-v <value>]
283
-
284
- ARGUMENTS
285
- COLLECTION The name of the collection to create
286
-
287
- FLAGS
288
- -v, --validator=<value> JSON schema validator for document validation (JSON string)
289
-
290
- GLOBAL FLAGS
291
- --json Format output as json.
292
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
293
- Any database region set in 'app.config.yaml' takes precedence over all of these.
294
- <options: amer|emea|apac|aus>
295
-
296
- DESCRIPTION
297
- Create a new collection in the database
298
-
299
- ALIASES
300
- $ aio app db col create
301
-
302
- EXAMPLES
303
- $ aio app db collection create users
304
-
305
- $ aio app db collection create inventory --validator '{"type": "object", "required": ["id", "quantity"]}' --json
306
-
307
- $ aio app db col create products --json
308
-
309
- $ aio app db col create products --validator '{"type": "object", "properties": {"name": {"type": "string"}, "price": {"type": "number", "minimum": 0}}, "required": ["name", "price"]}'
310
- ```
311
-
312
- ### `aio app db collection drop COLLECTION`
313
-
314
- Drop a collection from the database
315
-
316
- ```
317
- USAGE
318
- $ aio app db collection drop COLLECTION [--json] [--region <value>]
319
-
320
- ARGUMENTS
321
- COLLECTION The name of the collection to drop
322
-
323
- GLOBAL FLAGS
324
- --json Format output as json.
325
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
326
- Any database region set in 'app.config.yaml' takes precedence over all of these.
327
- <options: amer|emea|apac|aus>
328
-
329
- DESCRIPTION
330
- Drop a collection from the database
331
-
332
- ALIASES
333
- $ aio app db col drop
334
-
335
- EXAMPLES
336
- $ aio app db collection drop users
337
-
338
- $ aio app db collection drop products --json
339
-
340
- $ aio app db col drop inventory
341
- ```
342
-
343
- ### `aio app db collection rename CURRENTNAME NEWNAME`
189
+ ## `aio app db collection rename CURRENTNAME NEWNAME`
344
190
 
345
191
  Rename a collection in the database
346
192
 
@@ -354,8 +200,8 @@ ARGUMENTS
354
200
 
355
201
  GLOBAL FLAGS
356
202
  --json Format output as json.
357
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
358
- Any database region set in 'app.config.yaml' takes precedence over all of these.
203
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
204
+ database region set in 'app.config.yaml' takes precedence over all of these.
359
205
  <options: amer|emea|apac|aus>
360
206
 
361
207
  DESCRIPTION
@@ -372,7 +218,7 @@ EXAMPLES
372
218
  $ aio app db col rename inventory stock
373
219
  ```
374
220
 
375
- ### `aio app db collection stats COLLECTION`
221
+ ## `aio app db collection stats COLLECTION`
376
222
 
377
223
  Get statistics for a collection in the database
378
224
 
@@ -385,8 +231,8 @@ ARGUMENTS
385
231
 
386
232
  GLOBAL FLAGS
387
233
  --json Format output as json.
388
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
389
- Any database region set in 'app.config.yaml' takes precedence over all of these.
234
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
235
+ database region set in 'app.config.yaml' takes precedence over all of these.
390
236
  <options: amer|emea|apac|aus>
391
237
 
392
238
  DESCRIPTION
@@ -403,48 +249,69 @@ EXAMPLES
403
249
  $ aio app db col stats inventory
404
250
  ```
405
251
 
406
- ## Document Operations
252
+ ## `aio app db delete`
407
253
 
408
- > Note: The commands under `aio app db document <command>` are also available as `aio app db doc <command>` shorthand aliases.
254
+ Delete the database for your App Builder application (non-production only)
409
255
 
410
- ### `aio app db document insert COLLECTION DOCUMENTS`
256
+ ```
257
+ USAGE
258
+ $ aio app db delete [--json] [--region <value>] [--force]
411
259
 
412
- Insert one or more documents into a collection
260
+ FLAGS
261
+ --force [use with caution!] force delete, skips confirmation safety prompt
262
+
263
+ GLOBAL FLAGS
264
+ --json Format output as json.
265
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
266
+ database region set in 'app.config.yaml' takes precedence over all of these.
267
+ <options: amer|emea|apac|aus>
268
+
269
+ DESCRIPTION
270
+ Delete the database for your App Builder application (non-production only)
271
+
272
+ EXAMPLES
273
+ $ aio app db delete
274
+
275
+ $ aio app db delete --force
276
+
277
+ $ aio app db delete --json
278
+ ```
279
+
280
+ ## `aio app db document count COLLECTION [QUERY]`
281
+
282
+ Count documents in a collection
413
283
 
414
284
  ```
415
285
  USAGE
416
- $ aio app db document insert COLLECTION DOCUMENTS [--json] [--region <value>] [-b]
286
+ $ aio app db document count COLLECTION [QUERY] [--json] [--region <value>]
417
287
 
418
288
  ARGUMENTS
419
- COLLECTION The name of the collection to insert documents into
420
- DOCUMENTS JSON object or array of documents to insert
421
-
422
- FLAGS
423
- -b, --bypassDocumentValidation Bypass schema validation if present
289
+ COLLECTION The name of the collection
290
+ [QUERY] The query filter document (JSON string). If not provided, counts all documents.
424
291
 
425
292
  GLOBAL FLAGS
426
293
  --json Format output as json.
427
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
428
- Any database region set in 'app.config.yaml' takes precedence over all of these.
294
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
295
+ database region set in 'app.config.yaml' takes precedence over all of these.
429
296
  <options: amer|emea|apac|aus>
430
297
 
431
298
  DESCRIPTION
432
- Insert one or more documents into a collection
299
+ Count documents in a collection
433
300
 
434
301
  ALIASES
435
- $ aio app db doc insert
302
+ $ aio app db doc count
436
303
 
437
304
  EXAMPLES
438
- $ aio app db document insert users '{"name": "John", "age": 30}'
305
+ $ aio app db document countDocuments users
439
306
 
440
- $ aio app db document insert products '[{"id": 1, "name": "Product A"}, {"id": 2, "name": "Product B"}]' --json
307
+ $ aio app db document countDocuments users '{"age": {"$gte": 21}}'
441
308
 
442
- $ aio app db document insert temp '{"data": "test"}' --bypassDocumentValidation
309
+ $ aio app db document countDocuments products '{"category": "electronics"}' --json
443
310
 
444
- $ aio app db doc insert bulk '[{"field": "foo"}, {"field": "bar"}]' --bypassDocumentValidation --json
311
+ $ aio app db doc count orders '{"status": "shipped"}'
445
312
  ```
446
313
 
447
- ### `aio app db document delete COLLECTION FILTER`
314
+ ## `aio app db document delete COLLECTION FILTER`
448
315
 
449
316
  Delete a single document from a collection
450
317
 
@@ -458,8 +325,8 @@ ARGUMENTS
458
325
 
459
326
  GLOBAL FLAGS
460
327
  --json Format output as json.
461
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
462
- Any database region set in 'app.config.yaml' takes precedence over all of these.
328
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
329
+ database region set in 'app.config.yaml' takes precedence over all of these.
463
330
  <options: amer|emea|apac|aus>
464
331
 
465
332
  DESCRIPTION
@@ -476,13 +343,14 @@ EXAMPLES
476
343
  $ aio app db doc delete posts '{"status": "draft"}'
477
344
  ```
478
345
 
479
- ### `aio app db document find COLLECTION FILTER`
346
+ ## `aio app db document find COLLECTION FILTER`
480
347
 
481
348
  Find documents in a collection based on filter criteria.
482
349
 
483
350
  ```
484
351
  USAGE
485
- $ aio app db document find COLLECTION FILTER [--json] [--region <value>] [-l <value>] [-s <value>] [-o <value>] [-p <value>]
352
+ $ aio app db document find COLLECTION FILTER [--json] [--region <value>] [-l <value>] [-s <value>] [-o <value>] [-p
353
+ <value>]
486
354
 
487
355
  ARGUMENTS
488
356
  COLLECTION The name of the collection
@@ -496,8 +364,8 @@ FLAGS
496
364
 
497
365
  GLOBAL FLAGS
498
366
  --json Format output as json.
499
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
500
- Any database region set in 'app.config.yaml' takes precedence over all of these.
367
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
368
+ database region set in 'app.config.yaml' takes precedence over all of these.
501
369
  <options: amer|emea|apac|aus>
502
370
 
503
371
  DESCRIPTION
@@ -516,46 +384,44 @@ EXAMPLES
516
384
  $ aio app db doc find orders '{"status": "pending"}' --sort '{"orderDate": -1}'
517
385
  ```
518
386
 
519
- ### `aio app db document update COLLECTION FILTER UPDATE`
387
+ ## `aio app db document insert COLLECTION DOCUMENTS`
520
388
 
521
- Update document(s) in a collection
389
+ Insert one or more documents into a collection
522
390
 
523
391
  ```
524
392
  USAGE
525
- $ aio app db document update COLLECTION FILTER UPDATE [--json] [--region <value>] [-u] [-m]
393
+ $ aio app db document insert COLLECTION DOCUMENTS [--json] [--region <value>] [-b]
526
394
 
527
395
  ARGUMENTS
528
- COLLECTION The name of the collection
529
- FILTER The filter document (JSON string)
530
- UPDATE The update document (JSON string)
396
+ COLLECTION The name of the collection to insert documents into
397
+ DOCUMENTS JSON object or array of documents to insert
531
398
 
532
399
  FLAGS
533
- -m, --many Update all documents matching the filter. Without this option, only the first matching document is updated.
534
- -u, --upsert If no document is found, create a new one
400
+ -b, --bypassDocumentValidation Bypass schema validation if present
535
401
 
536
402
  GLOBAL FLAGS
537
403
  --json Format output as json.
538
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
539
- Any database region set in 'app.config.yaml' takes precedence over all of these.
404
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
405
+ database region set in 'app.config.yaml' takes precedence over all of these.
540
406
  <options: amer|emea|apac|aus>
541
407
 
542
408
  DESCRIPTION
543
- Update document(s) in a collection
409
+ Insert one or more documents into a collection
544
410
 
545
411
  ALIASES
546
- $ aio app db doc update
412
+ $ aio app db doc insert
547
413
 
548
414
  EXAMPLES
549
- $ aio app db document update users '{"name": "John"}' '{"$set": {"age": 31}}'
415
+ $ aio app db document insert users '{"name": "John", "age": 30}'
550
416
 
551
- $ aio app db document update products '{"id": "123"}' '{"$inc": {"stock": -1}}' --json
417
+ $ aio app db document insert products '[{"id": 1, "name": "Product A"}, {"id": 2, "name": "Product B"}]' --json
552
418
 
553
- $ aio app db document update posts '{"slug": "hello-world"}' '{"$set": {"status": "published"}}' --many
419
+ $ aio app db document insert temp '{"data": "test"}' --bypassDocumentValidation
554
420
 
555
- $ aio app db doc update users '{"email": "john@example.com"}' '{"$set": {"lastLogin": "2024-01-01"}}' --upsert
421
+ $ aio app db doc insert bulk '[{"field": "foo"}, {"field": "bar"}]' --bypassDocumentValidation --json
556
422
  ```
557
423
 
558
- ### `aio app db document replace COLLECTION FILTER REPLACEMENT`
424
+ ## `aio app db document replace COLLECTION FILTER REPLACEMENT`
559
425
 
560
426
  Replace a single document in a collection
561
427
 
@@ -573,8 +439,8 @@ FLAGS
573
439
 
574
440
  GLOBAL FLAGS
575
441
  --json Format output as json.
576
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
577
- Any database region set in 'app.config.yaml' takes precedence over all of these.
442
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
443
+ database region set in 'app.config.yaml' takes precedence over all of these.
578
444
  <options: amer|emea|apac|aus>
579
445
 
580
446
  DESCRIPTION
@@ -593,59 +459,61 @@ EXAMPLES
593
459
  $ aio app db doc replace users '{"email": "john@example.com"}' '{"email": "john@example.com", "name": "John", "verified": true}' --upsert --json
594
460
  ```
595
461
 
596
- ### `aio app db document count COLLECTION`
462
+ ## `aio app db document update COLLECTION FILTER UPDATE`
597
463
 
598
- Count documents in a collection
464
+ Update document(s) in a collection
599
465
 
600
466
  ```
601
467
  USAGE
602
- $ aio app db document count COLLECTION [QUERY] [--json] [--region <value>]
468
+ $ aio app db document update COLLECTION FILTER UPDATE [--json] [--region <value>] [-u] [-m]
603
469
 
604
470
  ARGUMENTS
605
471
  COLLECTION The name of the collection
606
- QUERY The query filter document (JSON string). If not provided, counts all documents.
472
+ FILTER The filter document (JSON string)
473
+ UPDATE The update document (JSON string)
474
+
475
+ FLAGS
476
+ -m, --many Update all documents matching the filter. Without this option, only the first matching document is
477
+ updated.
478
+ -u, --upsert If no document is found, create a new one
607
479
 
608
480
  GLOBAL FLAGS
609
481
  --json Format output as json.
610
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
611
- Any database region set in 'app.config.yaml' takes precedence over all of these.
482
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
483
+ database region set in 'app.config.yaml' takes precedence over all of these.
612
484
  <options: amer|emea|apac|aus>
613
485
 
614
486
  DESCRIPTION
615
- Count documents in a collection
487
+ Update document(s) in a collection
616
488
 
617
489
  ALIASES
618
- $ aio app db doc count
490
+ $ aio app db doc update
619
491
 
620
492
  EXAMPLES
621
- $ aio app db document countDocuments users
493
+ $ aio app db document update users '{"name": "John"}' '{"$set": {"age": 31}}'
622
494
 
623
- $ aio app db document countDocuments users '{"age": {"$gte": 21}}'
495
+ $ aio app db document update products '{"id": "123"}' '{"$inc": {"stock": -1}}' --json
624
496
 
625
- $ aio app db document countDocuments products '{"category": "electronics"}' --json
497
+ $ aio app db document update posts '{"slug": "hello-world"}' '{"$set": {"status": "published"}}' --many
626
498
 
627
- $ aio app db doc count orders '{"status": "shipped"}'
499
+ $ aio app db doc update users '{"email": "john@example.com"}' '{"$set": {"lastLogin": "2024-01-01"}}' --upsert
628
500
  ```
629
501
 
630
- ## Index Management
631
-
632
- > Note: The commands under `aio app db index <command>` are also available as `aio app db idx <command>` shorthand aliases.
633
-
634
- ### `aio app db index create COLLECTION`
502
+ ## `aio app db index create COLLECTION`
635
503
 
636
504
  Create a new index on a collection in the database
637
505
 
638
506
  ```
639
507
  USAGE
640
- $ aio app db index create COLLECTION [--json] [--region <value>] [-s <value>] [-k <value>] [-n <value>] [-u]
508
+ $ aio app db index create COLLECTION [--json] [--region <value>] [-s <value>...] [-k <value>...] [-n <value>] [-u]
641
509
 
642
510
  ARGUMENTS
643
511
  COLLECTION The name of the collection to create the index on
644
512
 
645
513
  FLAGS
646
514
  -n, --name=<value> A name that uniquely identifies the index
647
- -u, --unique Creates a unique index so that the collection will not accept insertion or update of documents where the index key value matches an
648
- existing value in the index
515
+ -u, --unique Creates a unique index so that the collection will not accept insertion or update of documents
516
+ where the index key value matches an existing value in the index
649
517
 
650
518
  REQUIRES AT LEAST ONE OF THE INDEX DEFINITION FLAGS
651
519
  -k, --key=<value>... Index key to use with default specification
@@ -653,8 +521,8 @@ REQUIRES AT LEAST ONE OF THE INDEX DEFINITION FLAGS
653
521
 
654
522
  GLOBAL FLAGS
655
523
  --json Format output as json.
656
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
657
- Any database region set in 'app.config.yaml' takes precedence over all of these.
524
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
525
+ database region set in 'app.config.yaml' takes precedence over all of these.
658
526
  <options: amer|emea|apac|aus>
659
527
 
660
528
  DESCRIPTION
@@ -679,7 +547,7 @@ EXAMPLES
679
547
  $ aio app db idx create orders --spec '{"customerId":1}' --spec '{"orderDate":-1}' --name "customer_order_index" --unique
680
548
  ```
681
549
 
682
- ### `aio app db index drop COLLECTION INDEXNAME`
550
+ ## `aio app db index drop COLLECTION INDEXNAME`
683
551
 
684
552
  Drop an index from a collection in the database
685
553
 
@@ -693,8 +561,8 @@ ARGUMENTS
693
561
 
694
562
  GLOBAL FLAGS
695
563
  --json Format output as json.
696
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
697
- Any database region set in 'app.config.yaml' takes precedence over all of these.
564
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
565
+ database region set in 'app.config.yaml' takes precedence over all of these.
698
566
  <options: amer|emea|apac|aus>
699
567
 
700
568
  DESCRIPTION
@@ -711,7 +579,7 @@ EXAMPLES
711
579
  $ aio app db idx drop orders orderDate_index
712
580
  ```
713
581
 
714
- ### `aio app db index list COLLECTION`
582
+ ## `aio app db index list COLLECTION`
715
583
 
716
584
  Get the list of indexes from a collection in the database
717
585
 
@@ -724,8 +592,8 @@ ARGUMENTS
724
592
 
725
593
  GLOBAL FLAGS
726
594
  --json Format output as json.
727
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
728
- Any database region set in 'app.config.yaml' takes precedence over all of these.
595
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
596
+ database region set in 'app.config.yaml' takes precedence over all of these.
729
597
  <options: amer|emea|apac|aus>
730
598
 
731
599
  DESCRIPTION
@@ -742,9 +610,35 @@ EXAMPLES
742
610
  $ aio app db idx list orders
743
611
  ```
744
612
 
745
- ## Database Management
613
+ ## `aio app db org stats`
614
+
615
+ Get combined statistics about the App Builder databases in your organization
616
+
617
+ ```
618
+ USAGE
619
+ $ aio app db org stats [--json] [--region <value>] [-s <value>]
620
+
621
+ FLAGS
622
+ -s, --scale=<value> [default: 1] Scale factor for size-related statistics (e.g. 1024 for KB, 1048576 for MB).
623
+
624
+ GLOBAL FLAGS
625
+ --json Format output as json.
626
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
627
+ database region set in 'app.config.yaml' takes precedence over all of these.
628
+ <options: amer|emea|apac|aus>
629
+
630
+ DESCRIPTION
631
+ Get combined statistics about the App Builder databases in your organization
632
+
633
+ EXAMPLES
634
+ $ aio app db org stats
635
+
636
+ $ aio app db org stats --scale 1024
637
+
638
+ $ aio app db org stats --json
639
+ ```
746
640
 
747
- ### `aio app db ping`
641
+ ## `aio app db ping`
748
642
 
749
643
  Test connectivity to your App Builder database
750
644
 
@@ -754,8 +648,8 @@ USAGE
754
648
 
755
649
  GLOBAL FLAGS
756
650
  --json Format output as json.
757
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
758
- Any database region set in 'app.config.yaml' takes precedence over all of these.
651
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
652
+ database region set in 'app.config.yaml' takes precedence over all of these.
759
653
  <options: amer|emea|apac|aus>
760
654
 
761
655
  DESCRIPTION
@@ -767,21 +661,21 @@ EXAMPLES
767
661
  $ aio app db ping --json
768
662
  ```
769
663
 
770
- ### `aio app db provision`
664
+ ## `aio app db provision`
771
665
 
772
666
  Provision a new database for your App Builder application
773
667
 
774
668
  ```
775
669
  USAGE
776
- $ aio app db provision [--json] [--region <value>] [-f]
670
+ $ aio app db provision [--json] [--region <value>] [-y]
777
671
 
778
672
  FLAGS
779
673
  -y, --yes Skip confirmation prompt and provision automatically
780
674
 
781
675
  GLOBAL FLAGS
782
676
  --json Format output as json.
783
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
784
- Any database region set in 'app.config.yaml' takes precedence over all of these.
677
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
678
+ database region set in 'app.config.yaml' takes precedence over all of these.
785
679
  <options: amer|emea|apac|aus>
786
680
 
787
681
  DESCRIPTION
@@ -797,35 +691,35 @@ EXAMPLES
797
691
  $ aio app db provision --yes
798
692
  ```
799
693
 
800
- ### `aio app db delete`
694
+ ## `aio app db stats`
801
695
 
802
- Delete the database for your App Builder application (non-production only)
696
+ Get statistics about your App Builder database
803
697
 
804
698
  ```
805
699
  USAGE
806
- $ aio app db delete [--json] [--region <value>] [--force]
700
+ $ aio app db stats [--json] [--region <value>] [-s <value>]
807
701
 
808
702
  FLAGS
809
- --force [use with caution!] force delete, skips confirmation safety prompt
703
+ -s, --scale=<value> [default: 1] Scale factor for size-related statistics (e.g. 1024 for KB, 1048576 for MB).
810
704
 
811
705
  GLOBAL FLAGS
812
706
  --json Format output as json.
813
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
814
- Any database region set in 'app.config.yaml' takes precedence over all of these.
707
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
708
+ database region set in 'app.config.yaml' takes precedence over all of these.
815
709
  <options: amer|emea|apac|aus>
816
710
 
817
711
  DESCRIPTION
818
- Delete the database for your App Builder application (non-production only)
712
+ Get statistics about your App Builder database
819
713
 
820
714
  EXAMPLES
821
- $ aio app db delete
715
+ $ aio app db stats
822
716
 
823
- $ aio app db delete --force
717
+ $ aio app db stats --scale 1024
824
718
 
825
- $ aio app db delete --json
719
+ $ aio app db stats --json
826
720
  ```
827
721
 
828
- ### `aio app db status`
722
+ ## `aio app db status`
829
723
 
830
724
  Check the provisioning status of your App Builder database
831
725
 
@@ -838,8 +732,8 @@ FLAGS
838
732
 
839
733
  GLOBAL FLAGS
840
734
  --json Format output as json.
841
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
842
- Any database region set in 'app.config.yaml' takes precedence over all of these.
735
+ --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
736
+ database region set in 'app.config.yaml' takes precedence over all of these.
843
737
  <options: amer|emea|apac|aus>
844
738
 
845
739
  DESCRIPTION
@@ -853,63 +747,165 @@ EXAMPLES
853
747
  $ aio app db status --json
854
748
  ```
855
749
 
856
- ### `aio app db stats`
750
+ ## `aio app state delete [KEYS]`
857
751
 
858
- Get statistics about your App Builder database
752
+ Delete key-values
859
753
 
860
754
  ```
861
755
  USAGE
862
- $ aio app db stats [--json] [--region <value>] [-s <value>]
756
+ $ aio app state delete [KEYS...] [--json] [--region amer|emea|apac|aus] [--match <value>] [--force]
757
+
758
+ ARGUMENTS
759
+ [KEYS...] keys to delete. Above 5 keys, you will be prompted for confirmation
863
760
 
864
761
  FLAGS
865
- -s, --scale=<value> [default: 1] Scale factor for size-related statistics (e.g. 1024 for KB, 1048576 for MB).
762
+ --force [use with caution!] force delete, no safety prompt
763
+ --match=<value> [use with caution!] deletes ALL key-values matching the provided glob-like pattern
764
+ --region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
765
+ <options: amer|emea|apac|aus>
866
766
 
867
767
  GLOBAL FLAGS
868
- --json Format output as json.
869
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or `amer` if neither is set.
870
- Any database region set in 'app.config.yaml' takes precedence over all of these.
871
- <options: amer|emea|apac|aus>
768
+ --json Format output as json.
872
769
 
873
770
  DESCRIPTION
874
- Get statistics about your App Builder database
771
+ Delete key-values
772
+
773
+ ALIASES
774
+ $ aio app state del
775
+ $ aio app state remove
776
+ $ aio app state rm
875
777
 
876
778
  EXAMPLES
877
- $ aio app db stats
779
+ $ aio app state delete key
878
780
 
879
- $ aio app db stats --scale 1024
781
+ $ aio app state delete key1 key2 key3
880
782
 
881
- $ aio app db stats --json
783
+ $ aio app state delete --match 'gl*b'
784
+
785
+ $ aio app state delete --match 'gl*b' --json
786
+
787
+ $ aio app state delete --match 'be-carreful*' --force
882
788
  ```
883
789
 
884
- ### `aio app db org stats`
790
+ ## `aio app state get KEY`
885
791
 
886
- Get combined statistics about the App Builder databases in your organization
792
+ Get a key-value
887
793
 
888
794
  ```
889
795
  USAGE
890
- $ aio app db org stats [--json] [--region <value>] [-s <value>]
796
+ $ aio app state get KEY [--json] [--region amer|emea|apac|aus]
797
+
798
+ ARGUMENTS
799
+ KEY State key
891
800
 
892
801
  FLAGS
893
- -s, --scale=<value> [default: 1] Scale factor for size-related statistics (e.g. 1024 for KB, 1048576 for MB).
802
+ --region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
803
+ <options: amer|emea|apac|aus>
894
804
 
895
805
  GLOBAL FLAGS
896
- --json Format output as json.
897
- --region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set.
898
- Any database region set in 'app.config.yaml' takes precedence over all of these.
899
- <options: amer|emea|apac|aus>
806
+ --json Format output as json.
900
807
 
901
808
  DESCRIPTION
902
- Get combined statistics about the App Builder databases in your organization
809
+ Get a key-value
903
810
 
904
811
  EXAMPLES
905
- $ aio app db org stats
812
+ $ aio app state get key
906
813
 
907
- $ aio app db org stats --scale 1024
814
+ $ aio app state get key --json
815
+
816
+ $ aio app state get key | wc -c
817
+ ```
818
+
819
+ ## `aio app state list`
820
+
821
+ List key-values
908
822
 
909
- $ aio app db org stats --json
910
823
  ```
824
+ USAGE
825
+ $ aio app state list [--json] [--region amer|emea|apac|aus] [-m <value>]
826
+
827
+ FLAGS
828
+ -m, --match=<value> [default: *] Glob-like pattern to filter keys
829
+ --region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
830
+ <options: amer|emea|apac|aus>
911
831
 
912
- # Other Commands
832
+ GLOBAL FLAGS
833
+ --json Format output as json.
834
+
835
+ DESCRIPTION
836
+ List key-values
837
+
838
+ ALIASES
839
+ $ aio app state ls
840
+
841
+ EXAMPLES
842
+ $ aio app state list
843
+
844
+ $ aio app state list --match 'gl*b'
845
+
846
+ $ aio app state list --json
847
+
848
+ $ aio app state list | less
849
+
850
+ $ aio app state list | wc -l
851
+ ```
852
+
853
+ ## `aio app state put KEY VALUE`
854
+
855
+ Put a key-value
856
+
857
+ ```
858
+ USAGE
859
+ $ aio app state put KEY VALUE [--json] [--region amer|emea|apac|aus] [-t <value>]
860
+
861
+ ARGUMENTS
862
+ KEY State key
863
+ VALUE State value
864
+
865
+ FLAGS
866
+ -t, --ttl=<value> Time to live in seconds. Default is 86400 (24 hours), max is 31536000 (1 year).
867
+ --region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
868
+ <options: amer|emea|apac|aus>
869
+
870
+ GLOBAL FLAGS
871
+ --json Format output as json.
872
+
873
+ DESCRIPTION
874
+ Put a key-value
875
+
876
+ EXAMPLES
877
+ $ aio app state put key value
878
+
879
+ $ aio app state put key value --ttl 3600
880
+
881
+ $ aio app state put key value --json
882
+
883
+ $ cat value/from/file | xargs -0 ./bin/run.js app state put key
884
+ ```
885
+
886
+ ## `aio app state stats`
887
+
888
+ Display stats
889
+
890
+ ```
891
+ USAGE
892
+ $ aio app state stats [--json] [--region amer|emea|apac|aus]
893
+
894
+ FLAGS
895
+ --region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
896
+ <options: amer|emea|apac|aus>
897
+
898
+ GLOBAL FLAGS
899
+ --json Format output as json.
900
+
901
+ DESCRIPTION
902
+ Display stats
903
+
904
+ EXAMPLES
905
+ $ aio app state stats
906
+
907
+ $ aio app state stats --json
908
+ ```
913
909
 
914
910
  ## `aio help [COMMAND]`
915
911
 
@@ -929,7 +925,7 @@ DESCRIPTION
929
925
  Display help for aio.
930
926
  ```
931
927
 
932
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.36/src/commands/help.ts)_
928
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/6.2.46/src/commands/help.ts)_
933
929
  <!-- commandsstop -->
934
930
 
935
931
  ## Contributing