{
"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函数
求play确实会给它阅读;我希望这有帮助。 让我知道您是否想要另一种语气 - 更正式,休闲或简洁! 🚀