Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save thelebster/ceaedd8a28f4ae266e5fdbf8cbb027ce to your computer and use it in GitHub Desktop.
Save thelebster/ceaedd8a28f4ae266e5fdbf8cbb027ce to your computer and use it in GitHub Desktop.
jq - select objects based on lengths of arrays
# objects with at least one widget and at least one user
$ cat part-r-00000 | jq 'select((.widgets | length) > 0 and (.users | length) > 0)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment