仅捕获以下数组中第二个对象的正确jmespath表达式是什么(因为它的 topics 数组):
topics
[{ "topics": [ "just one" ] }, { "topics": [ "first", "second", "third" ] } ]
我想把它吐出来
{ "topics": [ "first", "second", "third" ] }
我试过了 [? length(topics) > 2] 但是 jp 抱怨:
[? length(topics) > 2]
jp
SyntaxError: Invalid token: tNumber [? length(topics) > 2] ^
输入:
使用jmesexpression:
[?length(topics)>'2']
获得产出:
[ { "topics": [ "first", "second", "third" ] } ]