gpt4 book ai didi

JmesPath 查找不存在的地方

转载 作者:行者123 更新时间:2023-12-03 23:38:12 26 4
gpt4 key购买 nike

以下 JmesPath 表达式查找已标记为团队的实例:

"Instances[?Tags[?Key=='team']]"

您知道如何查找未标记为团队的实例吗?

我试过了:
"Instances[?!Tags[?Key=='team']]"
-> !Tags[?Key=='team']]: event not found
"Instances[?null==Tags[?Key=='team']]"
-> [] <-- wrong answer
"Instances[?!not_null(Tags[?Key=='team'])]"
-> !not_null: event not found

提前谢谢了!

样本输入:
{ "Instances":
[ { "id": "i-911"
, "Tags":
[ {"Key":"owner", "Value":"Edu"}
, {"Key":"team", "Value":"forensics"}
]
, "many other keys": "stuff"
}
, { "id": "i-999"
, "Tags":
[ {"Key":"owner", "Value":"Edu"}
, {"Key":"note", "Value":"No team!"}
]
, "many other keys": "stuff"
}
]
}

最佳答案

已解决:括号是答案:

"Instances[?!(Tags[?Key=='team'])]"

关于JmesPath 查找不存在的地方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42396971/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com