aio-cli-plugin-app-存储器
管理您的 App 构建器状态存储和数据库服务的 CLI 插件 .
如果您需要通过程序访问国家,请检查 @adobe/aio-lib-状态 图书馆.
如果您需要程序访问数据库, 请检查 @adobe/aio-lib-db 图书馆.
使用量
$ aio plugins:install @adobe/aio-cli-plugin-app-storage
$ # OR
$ aio discover -i
$ aio app state --help
$ aio app db --help
图标
aio app add dbaio app db collection create COLLECTIONaio app db collection drop COLLECTIONaio app db collection listaio app db collection rename CURRENTNAME NEWNAMEaio app db collection stats COLLECTIONaio app db deleteaio app db document count COLLECTION [QUERY]aio app db document delete COLLECTION FILTERaio app db document find COLLECTION FILTERaio app db document insert COLLECTION DOCUMENTSaio app db document replace COLLECTION FILTER REPLACEMENTaio app db document update COLLECTION FILTER UPDATEaio app db index create COLLECTIONaio app db index drop COLLECTION INDEXNAMEaio app db index list COLLECTIONaio app db org statsaio app db pingaio app db provisionaio app db statsaio app db statusaio app state delete [KEYS]aio app state get KEYaio app state listaio app state put KEY VALUEaio app state statsaio help [COMMAND]
aio app add db
为您的 App 构建程序提供新数据库
USAGE
$ aio app add db [--json] [--region <value>] [-y]
FLAGS
-y, --yes Skip confirmation prompt and provision automatically
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Provision a new database for your App Builder application
EXAMPLES
$ aio app add db
$ aio app add db --region amer
$ aio app add db --json
$ aio app add db --yes
aio app db collection create COLLECTION
在数据库中创建新收藏
USAGE
$ aio app db collection create COLLECTION [--json] [--region <value>] [-v <value>]
ARGUMENTS
COLLECTION The name of the collection to create
FLAGS
-v, --validator=<value> JSON schema validator for document validation (JSON string)
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Create a new collection in the database
ALIASES
$ aio app db col create
EXAMPLES
$ aio app db collection create users
$ aio app db collection create inventory --validator '{"type": "object", "required": ["id", "quantity"]}' --json
$ aio app db col create products --json
$ aio app db col create products --validator '{"type": "object", "properties": {"name": {"type": "string"}, "price": {"type": "number", "minimum": 0}}, "required": ["name", "price"]}'
aio app db collection drop COLLECTION
从数据库中丢弃收藏
USAGE
$ aio app db collection drop COLLECTION [--json] [--region <value>]
ARGUMENTS
COLLECTION The name of the collection to drop
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Drop a collection from the database
ALIASES
$ aio app db col drop
EXAMPLES
$ aio app db collection drop users
$ aio app db collection drop products --json
$ aio app db col drop inventory
aio app db collection list
在您的 App 构建器数据库中获取收藏列表
USAGE
$ aio app db collection list [--json] [--region <value>] [-i]
FLAGS
-i, --info Show detailed collection information instead of just names
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Get the list of collections in your App Builder database
ALIASES
$ aio app db col list
$ aio app db show collections
EXAMPLES
$ aio app db collection list
$ aio app db collection list --info
$ aio app db collection list --json
$ aio app db col list --info --json
aio app db collection rename CURRENTNAME NEWNAME
重命名数据库中的收藏
USAGE
$ aio app db collection rename CURRENTNAME NEWNAME [--json] [--region <value>]
ARGUMENTS
CURRENTNAME The current name of the collection to rename
NEWNAME The new name for the collection
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Rename a collection in the database
ALIASES
$ aio app db col rename
EXAMPLES
$ aio app db collection rename users customers
$ aio app db collection rename old_products new_products --json
$ aio app db col rename inventory stock
aio app db collection stats COLLECTION
获取数据库收藏的统计数据
USAGE
$ aio app db collection stats COLLECTION [--json] [--region <value>]
ARGUMENTS
COLLECTION The name of the collection to get stats for
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Get statistics for a collection in the database
ALIASES
$ aio app db col stats
EXAMPLES
$ aio app db collection stats users
$ aio app db collection stats products --json
$ aio app db col stats inventory
aio app db delete
删除您的 App 构建器应用程序的数据库( 不只生产)
USAGE
$ aio app db delete [--json] [--region <value>] [--force]
FLAGS
--force [use with caution!] force delete, skips confirmation safety prompt
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Delete the database for your App Builder application (non-production only)
EXAMPLES
$ aio app db delete
$ aio app db delete --force
$ aio app db delete --json
aio app db document count COLLECTION [QUERY]
计算收藏中的文档
USAGE
$ aio app db document count COLLECTION [QUERY] [--json] [--region <value>]
ARGUMENTS
COLLECTION The name of the collection
[QUERY] The query filter document (JSON string). If not provided, counts all documents.
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Count documents in a collection
ALIASES
$ aio app db doc count
EXAMPLES
$ aio app db document countDocuments users
$ aio app db document countDocuments users '{"age": {"$gte": 21}}'
$ aio app db document countDocuments products '{"category": "electronics"}' --json
$ aio app db doc count orders '{"status": "shipped"}'
aio app db document delete COLLECTION FILTER
从收藏中删除单个文档
USAGE
$ aio app db document delete COLLECTION FILTER [--json] [--region <value>]
ARGUMENTS
COLLECTION The name of the collection
FILTER The filter document (JSON string)
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Delete a single document from a collection
ALIASES
$ aio app db doc delete
EXAMPLES
$ aio app db document delete users '{"name": "John"}'
$ aio app db document delete products '{"id": "123"}' --json
$ aio app db doc delete posts '{"status": "draft"}'
aio app db document find COLLECTION FILTER
在一个基于过滤标准的集合中查找文档.
USAGE
$ aio app db document find COLLECTION FILTER [--json] [--region <value>] [-l <value>] [-s <value>] [-o <value>] [-p
<value>]
ARGUMENTS
COLLECTION The name of the collection
FILTER Filter criteria for the documents to find (JSON string, e.g. '{"status": "active"}')
FLAGS
-l, --limit=<value> [default: 20] Limit the number of documents returned, max: 100
-o, --sort=<value> Sort specification as a JSON object (e.g. '{"field": 1}')
-p, --projection=<value> Projection specification as a JSON object (e.g. '{"field1": 1, "field2": 0}')
-s, --skip=<value> Skip the first N documents
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Find documents in a collection based on filter criteria.
ALIASES
$ aio app db doc find
EXAMPLES
$ aio app db document find users '{}'
$ aio app db document find products '{"category": "Computer Accessories"}' --json
$ aio app db document find products '{"name": {"$regex": "Speakers$"}}' --sort '{"price": -1}' --limit 10 --skip 5 --projection '{"name": 1, "price": 1}'
$ aio app db doc find orders '{"status": "pending"}' --sort '{"orderDate": -1}'
aio app db document insert COLLECTION DOCUMENTS
在收藏中插入一个或多个文档
USAGE
$ aio app db document insert COLLECTION DOCUMENTS [--json] [--region <value>] [-b]
ARGUMENTS
COLLECTION The name of the collection to insert documents into
DOCUMENTS JSON object or array of documents to insert
FLAGS
-b, --bypassDocumentValidation Bypass schema validation if present
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Insert one or more documents into a collection
ALIASES
$ aio app db doc insert
EXAMPLES
$ aio app db document insert users '{"name": "John", "age": 30}'
$ aio app db document insert products '[{"id": 1, "name": "Product A"}, {"id": 2, "name": "Product B"}]' --json
$ aio app db document insert temp '{"data": "test"}' --bypassDocumentValidation
$ aio app db doc insert bulk '[{"field": "foo"}, {"field": "bar"}]' --bypassDocumentValidation --json
aio app db document replace COLLECTION FILTER REPLACEMENT
在收藏中替换单个文档
USAGE
$ aio app db document replace COLLECTION FILTER REPLACEMENT [--json] [--region <value>] [-u]
ARGUMENTS
COLLECTION The name of the collection
FILTER The filter document (JSON string)
REPLACEMENT The replacement document (JSON string)
FLAGS
-u, --upsert If no document is found, create a new one
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Replace a single document in a collection
ALIASES
$ aio app db doc replace
EXAMPLES
$ aio app db document replace users '{"name": "John"}' '{"name": "John Doe", "age": 30, "status": "active"}'
$ aio app db document replace products '{"id": "123"}' '{"id": "123", "name": "New Product", "price": 99.99}' --json
$ aio app db document replace posts '{"slug": "hello-world"}' '{"title": "Hello World", "content": "Updated content", "status": "published"}' --upsert
$ aio app db doc replace users '{"email": "[email protected]"}' '{"email": "[email protected]", "name": "John", "verified": true}' --upsert --json
aio app db document update COLLECTION FILTER UPDATE
更新收藏中的文档
USAGE
$ aio app db document update COLLECTION FILTER UPDATE [--json] [--region <value>] [-u] [-m]
ARGUMENTS
COLLECTION The name of the collection
FILTER The filter document (JSON string)
UPDATE The update document (JSON string)
FLAGS
-m, --many Update all documents matching the filter. Without this option, only the first matching document is
updated.
-u, --upsert If no document is found, create a new one
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Update document(s) in a collection
ALIASES
$ aio app db doc update
EXAMPLES
$ aio app db document update users '{"name": "John"}' '{"$set": {"age": 31}}'
$ aio app db document update products '{"id": "123"}' '{"$inc": {"stock": -1}}' --json
$ aio app db document update posts '{"slug": "hello-world"}' '{"$set": {"status": "published"}}' --many
$ aio app db doc update users '{"email": "[email protected]"}' '{"$set": {"lastLogin": "2024-01-01"}}' --upsert
aio app db index create COLLECTION
在数据库中的收藏上创建新索引
USAGE
$ aio app db index create COLLECTION [--json] [--region <value>] [-s <value>...] [-k <value>...] [-n <value>] [-u]
ARGUMENTS
COLLECTION The name of the collection to create the index on
FLAGS
-n, --name=<value> A name that uniquely identifies the index
-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 existing value in the index
REQUIRES AT LEAST ONE OF THE INDEX DEFINITION FLAGS
-k, --key=<value>... Index key to use with default specification
-s, --spec=<value>... Index specification as a JSON object (e.g., '{"name":1, "age":-1}')
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Create a new index on a collection in the database
ALIASES
$ aio app db idx create
EXAMPLES
$ aio app db index create users --spec '{"name":1, "age":-1}'
$ aio app db index create users -s '{"name":1, "age":-1}' --name "name_age_index"
$ aio app db index create students -s '{"name":1}' --key grade --unique
$ aio app db index create reviews -k sku -k rating
$ aio app db index create products -s '{"name":"text", "category":"text"}' --json
$ aio app db index create books -s '{"author":1}' -k year
$ aio app db idx create orders --spec '{"customerId":1}' --spec '{"orderDate":-1}' --name "customer_order_index" --unique
aio app db index drop COLLECTION INDEXNAME
从数据库中的收藏中丢出索引
USAGE
$ aio app db index drop COLLECTION INDEXNAME [--json] [--region <value>]
ARGUMENTS
COLLECTION The name of the collection to drop the index from
INDEXNAME The name of the index to drop
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Drop an index from a collection in the database
ALIASES
$ aio app db idx drop
EXAMPLES
$ aio app db index drop users name_age_index
$ aio app db index drop products category_1 --json
$ aio app db idx drop orders orderDate_index
aio app db index list COLLECTION
从数据库的收藏中获取索引列表
USAGE
$ aio app db index list COLLECTION [--json] [--region <value>]
ARGUMENTS
COLLECTION The name of the collection to retrieve indexes from
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Get the list of indexes from a collection in the database
ALIASES
$ aio app db idx list
EXAMPLES
$ aio app db index list users
$ aio app db index list products --json
$ aio app db idx list orders
aio app db org stats
获取您组织的 App 构建器数据库的综合统计数据
USAGE
$ aio app db org stats [--json] [--region <value>] [-s <value>]
FLAGS
-s, --scale=<value> [default: 1] Scale factor for size-related statistics (e.g. 1024 for KB, 1048576 for MB).
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Get combined statistics about the App Builder databases in your organization
EXAMPLES
$ aio app db org stats
$ aio app db org stats --scale 1024
$ aio app db org stats --json
aio app db ping
测试您的 App 构建器数据库的连接
USAGE
$ aio app db ping [--json] [--region <value>]
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Test connectivity to your App Builder database
EXAMPLES
$ aio app db ping
$ aio app db ping --json
aio app db provision
为您的 App 构建程序提供新数据库
USAGE
$ aio app db provision [--json] [--region <value>] [-y]
FLAGS
-y, --yes Skip confirmation prompt and provision automatically
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Provision a new database for your App Builder application
EXAMPLES
$ aio app db provision
$ aio app db provision --region amer
$ aio app db provision --json
$ aio app db provision --yes
aio app db stats
获取关于您的 App 构建器数据库的统计数据
USAGE
$ aio app db stats [--json] [--region <value>] [-s <value>]
FLAGS
-s, --scale=<value> [default: 1] Scale factor for size-related statistics (e.g. 1024 for KB, 1048576 for MB).
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Get statistics about your App Builder database
EXAMPLES
$ aio app db stats
$ aio app db stats --scale 1024
$ aio app db stats --json
aio app db status
检查您的 App 构建器数据库的提供状态
USAGE
$ aio app db status [--json] [--region <value>] [--watch]
FLAGS
--watch Watch for status changes (press Ctrl+C to stop)
GLOBAL FLAGS
--json Format output as json.
--region=<value> Database region. Defaults to 'AIO_DB_REGION' environment variable or 'amer' if neither is set. Any
database region set in 'app.config.yaml' takes precedence over all of these.
<options: amer|emea|apac|aus>
DESCRIPTION
Check the provisioning status of your App Builder database
EXAMPLES
$ aio app db status
$ aio app db status --watch
$ aio app db status --json
aio app state delete [KEYS]
删除密钥值
USAGE
$ aio app state delete [KEYS...] [--json] [--region amer|emea|apac|aus] [--match <value>] [--force]
ARGUMENTS
[KEYS...] keys to delete. Above 5 keys, you will be prompted for confirmation
FLAGS
--force [use with caution!] force delete, no safety prompt
--match=<value> [use with caution!] deletes ALL key-values matching the provided glob-like pattern
--region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
<options: amer|emea|apac|aus>
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Delete key-values
ALIASES
$ aio app state del
$ aio app state remove
$ aio app state rm
EXAMPLES
$ aio app state delete key
$ aio app state delete key1 key2 key3
$ aio app state delete --match 'gl*b'
$ aio app state delete --match 'gl*b' --json
$ aio app state delete --match 'be-carreful*' --force
aio app state get KEY
获取密钥值
USAGE
$ aio app state get KEY [--json] [--region amer|emea|apac|aus]
ARGUMENTS
KEY State key
FLAGS
--region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
<options: amer|emea|apac|aus>
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Get a key-value
EXAMPLES
$ aio app state get key
$ aio app state get key --json
$ aio app state get key | wc -c
aio app state list
列出密钥值
USAGE
$ aio app state list [--json] [--region amer|emea|apac|aus] [-m <value>]
FLAGS
-m, --match=<value> [default: *] Glob-like pattern to filter keys
--region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
<options: amer|emea|apac|aus>
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
List key-values
ALIASES
$ aio app state ls
EXAMPLES
$ aio app state list
$ aio app state list --match 'gl*b'
$ aio app state list --json
$ aio app state list | less
$ aio app state list | wc -l
aio app state put KEY VALUE
设置密钥值
USAGE
$ aio app state put KEY VALUE [--json] [--region amer|emea|apac|aus] [-t <value>]
ARGUMENTS
KEY State key
VALUE State value
FLAGS
-t, --ttl=<value> Time to live in seconds. Default is 86400 (24 hours), max is 31536000 (1 year).
--region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
<options: amer|emea|apac|aus>
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Put a key-value
EXAMPLES
$ aio app state put key value
$ aio app state put key value --ttl 3600
$ aio app state put key value --json
$ cat value/from/file | xargs -0 ./bin/run.js app state put key
aio app state stats
显示数据
USAGE
$ aio app state stats [--json] [--region amer|emea|apac|aus]
FLAGS
--region=<option> State region. Defaults to 'AIO_STATE_REGION' env or 'amer' if neither is set.
<options: amer|emea|apac|aus>
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Display stats
EXAMPLES
$ aio app state stats
$ aio app state stats --json
aio help [COMMAND]
显示 Aio 的帮助 .
USAGE
$ aio help [COMMAND...] [-n]
ARGUMENTS
[COMMAND...] Command to show help for.
FLAGS
-n, --nested-commands Include all nested commands in the output.
DESCRIPTION
Display help for aio.
参见代码 : @oclif/plugin-帮助
捐款
欢迎捐款! 读取 贡献指南 更多信息.
许可证发放
这个项目根据Apache V2许可证获得许可. 见 自由主义 更多信息.