写入 Redis 集
在下面的示例中,数据是从名为invoice
并写入 Redis 集。这connection
是一个可选参数,它引用config.yaml
.当您指定data_type
参数,它会覆盖系统范围的设置target_data_type
定义于config.yaml
.
写入集合时,必须提供额外的参数member
,它指定要写入的字段。在这种情况下,结果将是一个 Redis 集,其中包含基于键表达式的键名称(例如invoices:Germany
,invoices:USA
) 的 Intent Package,有效期为 100 秒。如果您不提供expire
参数,则密钥永远不会过期。
source:
server_name: chinook
schema: public
table: invoice
output:
- uses: redis.write
with:
connection: target
data_type: set
key:
expression: concat(['invoices:', BillingCountry])
language: jmespath
args:
member: InvoiceId
expire: 100