gpt4 book ai didi

jmespath - JMESPath 有恒等函数吗?

转载 作者:行者123 更新时间:2023-12-05 05:12:21 24 4
gpt4 key购买 nike

在 jq 过滤语言中,. 过滤器表达式简单地返回输入的 JSON 不变( pretty-print 除外)。例如

$ echo '{"foo": true, "bar": 42}' | jq '.'
{
"foo": true,
"bar": 42
}

JMESPath 是否有类似的表达式(又名 identity function )?

最佳答案

current-node运算符在 JMESPath 中执行此功能,例如

$ echo '{"foo": true, "bar": 42}' | ~/.local/go/bin/jp @
{
"bar": 42,
"foo": true
}

感谢 jdevillard https://gitter.im/jmespath/chat求答案。

关于jmespath - JMESPath 有恒等函数吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54622275/

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