aws stepfunctions sum()函数返回错误的错误

问题描述 投票:0回答:2
我具有输入的步骤:

{ "Jobs": [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0] }
我想要此数组中的值的总和。根据

json-path文档应该为此存在.sum()

函数。当我尝试时,它甚至可以工作。因此,我定义了以下通过状态:
"Sum Jobs": { "Type": "Pass", "Parameters": { "Jobs.$": "$.Jobs.sum()" } },

尽管如此,执行失败了:
"An error occurred while executing the state 'Sum Jobs' (entered at the event id #249). The JSONPath '$.Jobs.sum()' specified for the field 'Jobs.$' could not be found in the input '{\"Jobs\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0]}'"

您将需要一个lambda任务。 step函数的
intrinsic函数
amazon-web-services jsonpath aws-step-functions
2个回答
1
投票

如何在AWS步骤函数中总结一个数组


0
投票
我很高兴与您分享我的技术文档!我很想听听您的想法 - 让我知道您是否觉得有趣。您的反馈意义重大,将帮助我改善。期待您的见解!”

求play确实会给它阅读;我希望这有帮助。 让我知道您是否想要另一种语气 - 更正式,休闲或简洁! 🚀

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.