我试图在AWS函数中使用InputPath过滤器来选择一部分JSON状态输入,以便与JSONPath表达式一起使用。
数据
[
{
"ticker": "DE30_EUR",
"granularity": "M"
},
{
"ticker": "DE30_EUR",
"granularity": "W"
},
{
"ticker": "DE30_EUR",
"granularity": "D"
},
{
"ticker": "DE30_EUR",
"granularity": "H1"
}
]当前JSONPath表达式
$[?(@.granularity==H1),?(@.granularity==D),?(@.granularity==W)]当使用AWS Step函数对上面的数据进行数据流模拟时,这是可行的,并且只返回粒度为"H1“、"D”或"W“的数组项。
问题
但是,当使用step函数作为InputPath或OutputPath时,它返回一个与数据流模拟器不同的空数组。
发布于 2021-11-22 06:33:15
试试下面的JSONPath
$[?(@.granularity=='H1'|| @.granularity=='D' || @.granularity=='W')]发布于 2022-08-02 21:42:37
以下是从aws文档中引用的,这个限制对我来说是很难理解的。
引用路径是其语法受到限制的路径,它只能识别JSON结构中的单个节点:
不支持
参考资料:
https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-paths.html
https://stackoverflow.com/questions/70057310
复制相似问题