simeji/jid

jq's .[] filter doesn't work

Closed this issue · 4 comments

The .[] filter works fine in jq:

❯ echo '[{"id":1},{"id":2}]' | jq '.[]'
{
  "id": 1
}
{
  "id": 2
}

But returns null in jid.

Is there any reason for this? I couldn't spot any explanation in the documentation.

Thanks!

jid is not jq, it uses its own parsing and filtering mechanism.

If you want jq's filters, try jiq, a jid's fork that actually uses jq behind the scenes.

Thanks!

The README makes it sound like it uses jq internally, or at least has parity:

You can drill down JSON interactively by using filtering queries like jq.

May I suggest we include a note to say it is not the same?

@OliverJAsh I thought it would use jq syntax based on the blurb at the top