Find key-value pairs
Find is useful for find paths of key/value pairs. Using --help shows some examples along with the following table:
| Comparison | Op | Alternative |
|---|---|---|
| equals | = |
eq |
| not equals | != |
ne |
| less than | < |
lt |
| greater than | > |
gt |
| less than equal | <= |
lte |
| greater than equal | >= |
gte |
To find a path, the key, comparison operator (as show above, including alternatives) and value must be given.
Consider the following JSONL file:
| arr-dev.jsonl | |
|---|---|
Key / values can be found for example:
Prints the following output:
Comparisons can also be disjunct using --or:
Outputting the result:
Likewise comparisons can also be conjunct using --and:
Outputting the result:
Using the --parent or shorthand -p can be used in combination with the --and to get the path of a object.
Outputting the result:
Using paths can be used to do relative matching is also possible:
Outputting the result: