Jq: 添加选项以不打印查询将导致“空”的记录

创建于 2012-10-22  ·  3评论  ·  资料来源: stedolan/jq

在命令末尾抛出“grep -v null”很容易,但是在许多(大多数?)我正在对字段名称进行查询的情况下,我不想要查询会导致的记录记录上的不匹配。

feature request

最有用的评论

交替:
jq '.foo // empty

所有3条评论

jq 'foo | select(. == null | not)'

应该做的伎俩

嗯,对于更广泛、更常见的不希望输出中出现任何空值的用例,使用通用命令行选项似乎会更简单。

交替:
jq '.foo // empty

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

thedward picture thedward  ·  3评论

ve3ied picture ve3ied  ·  4评论

ghost picture ghost  ·  4评论

tischwa picture tischwa  ·  4评论

tbelaire picture tbelaire  ·  4评论