[GH-ISSUE #4067] [feature]: Use jq instead of JSONPath for filtering JSON #1451

Closed
opened 2026-03-16 20:22:29 +03:00 by kerem · 3 comments
Owner

Originally created by @KaKi87 on GitHub (May 15, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4067

Is there an existing issue for this?

  • I have searched the existing issues

Summary

Use jq instead of JSONPath for filtering JSON.

Why should this be worked on?

The syntax is more intuitive :

Action jq JSONPath
Get full data . $.
Get object property .name $.name
Get first array item .[0] $.[0]
Get first array item property .[0].name $.[0].name
Get first array item subproperty .[0].owner.username $.[0].owner.username
Filter array by item property .[] | select(.id == 411) $[?(@.id == 411)]
Filter array by item subproperty .[] | select(.owner.id == 1) $[?(@.owner.id == 1)]
Filter array by item property range .[] | select(.stars_count > 0) $[?(@.stars_count > 0)]
Get property of array items filtered by property range .[] | select(.stars_count > 0) | .name $[?(@.stars_count > 0)].name
Sort array items by property . | sort_by(.id) Feature missing
Filter and sort array map(select(.stars_count > 0)) | sort_by(.id) Feature missing
Get property of filtered and sorted array items map(select(.stars_count > 0)) | sort_by(.id) | .name Feature missing
Filter array by item property via regex .[] | select(.created_at | test("^202[34]")) $[?(/^202[34]/.test(@.created_at))]

Etc...


Thanks

Originally created by @KaKi87 on GitHub (May 15, 2024). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4067 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Summary Use [jq](https://en.wikipedia.org/wiki/Jq_(programming_language)) instead of [JSONPath](https://en.wikipedia.org/wiki/JSONPath) for filtering JSON. ### Why should this be worked on? The syntax is more intuitive : | Action | jq | JSONPath | -- | -- | -- | Get full data | `.` | `$.` | Get object property | `.name` | `$.name` | Get first array item | `.[0]` | `$.[0]` | Get first array item property | `.[0].name` | `$.[0].name` | Get first array item subproperty | `.[0].owner.username` | `$.[0].owner.username` | Filter array by item property | `.[] \| select(.id == 411)` | `$[?(@.id == 411)]` | Filter array by item subproperty | `.[] \| select(.owner.id == 1)` | `$[?(@.owner.id == 1)]` | Filter array by item property range | `.[] \| select(.stars_count > 0)` | `$[?(@.stars_count > 0)]` | Get property of array items filtered by property range | `.[] \| select(.stars_count > 0) \| .name` | `$[?(@.stars_count > 0)].name` | Sort array items by property | `. \| sort_by(.id)` | Feature missing | Filter and sort array | `map(select(.stars_count > 0)) \| sort_by(.id)` | Feature missing | Get property of filtered and sorted array items | `map(select(.stars_count > 0)) \| sort_by(.id) \| .name` | Feature missing | Filter array by item property via regex | `.[] \| select(.created_at \| test("^202[34]"))` | `$[?(/^202[34]/.test(@.created_at))]` Etc... --- Thanks
kerem 2026-03-16 20:22:29 +03:00
  • closed this issue
  • added the
    feature
    label
Author
Owner

@anmol-fzr commented on GitHub (May 20, 2024):

Hi 👋, I would like to work on this issue. Can you assign this issue to me.

<!-- gh-comment-id:2121002856 --> @anmol-fzr commented on GitHub (May 20, 2024): Hi 👋, I would like to work on this issue. Can you assign this issue to me.
Author
Owner

@KaKi87 commented on GitHub (May 30, 2024):

Hi, I don't have the permission to assign, but feel free to work on this, I'm looking forward to it :)

<!-- gh-comment-id:2139637643 --> @KaKi87 commented on GitHub (May 30, 2024): Hi, I don't have the permission to assign, but feel free to work on this, I'm looking forward to it :)
Author
Owner

@jamesgeorge007 commented on GitHub (Jan 28, 2026):

Closing since this is now addressed in the v2026.1.0 release.

<!-- gh-comment-id:3810927121 --> @jamesgeorge007 commented on GitHub (Jan 28, 2026): Closing since this is now addressed in the [v2026.1.0](https://github.com/hoppscotch/hoppscotch/releases/tag/2026.1.0) release.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1451
No description provided.