Slide 7
Slide 7 text
© 2024, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Confidential and Trademark.
JSONataはOSSのJSON用データクエリおよび変換言語
日付・時刻のフォーマット、文字列操作、四則演算などが可能
JSONPath
+ Intrinsic Functions + Lambda
JSONata
JSONata によるデータ変換
7
"Calculate": {
"QueryLanguage": "JSONata-2.0",
"Type": "Task",
...
"Assign": {
"sum.$": "$sum($states.result.Product.(Price
* Count))"
}
}
"Get prices and quantities": {
"Type": "Task",
...
"ResultSelector": {
"Prices.$": "$.Product.Price",
"Counts.$": "$.Product.Count"
},
"ResultPath": "$.productInfo",
"Next": "Calculate"
},
"Calculate": {
"Type": "Task",
"Resource":
"arn:...:lambda:invoke",
"Parameters": {
"FunctionName": "lambdaArn",
"Payload.$": "$.productInfo"
},
"ResultSelector": {
"sum.$": "$.Payload.sum"
},
"ResultPath": "$.ProductSum",
...
}
商品の価格・数量から合計⾦額を計算する例
⼀
般
利
⽤
開
始