docs: convert jq examples to JMESPath queries#515
Merged
joshrotenberg merged 2 commits intomainfrom Dec 17, 2025
Merged
Conversation
Replace piped jq commands with redisctl's built-in -q/--query flag
and --raw option throughout documentation. This demonstrates
redisctl's native query capabilities and reduces external dependencies.
Conversions include:
- Field extraction: | jq '.field' → -q 'field'
- Array iteration: | jq -r '.[]' → -q '[]' --raw
- Filtering: | jq '.[] | select(.x=="y")' → -q '[?x==`y`]'
- Projections: | jq '{a,b}' → -q '{a: a, b: b}'
jq is intentionally retained for:
- CSV output formatting (@csv)
- Complex aggregations (group_by, add)
- Arithmetic operations (division, percentages)
- String manipulation (split, interpolation)
- JSON schema validation
Closes #514
Leverage redisctl's extended JMESPath functions to convert additional jq examples that require advanced features: - group_by() for grouping arrays by field value - divide()/multiply() for arithmetic operations - sprintf() for formatted string output - has() for key existence checks - join() for array-to-string conversion Remaining jq usage is limited to: - @csv output formatting (no JMESPath equivalent) - Pretty-printing raw JSON (jq .)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace piped jq commands with redisctl's built-in
-q/--queryflag and--rawoption throughout documentation. This demonstrates redisctl's native query capabilities and reduces external dependencies.Changes
57 files modified across all documentation sections:
Conversion Patterns
jq Retained For
Some jq usages were intentionally kept where JMESPath lacks equivalent features:
@csv)group_by,add)split, string interpolation)Closes #514