Step: Filter expression: [?(@.x<10)]
Filter expression: [?(@.x<10)]
Filter expressions let you keep only the elements that match a condition. The syntax is [?(<expression>)], where @ refers to the current element being tested.
For example $.pets[?(@.age>4)] returns every pet whose age field is greater than 4, and $.pets[?(@.kind=="dog")] returns only the dogs.
You can compare numbers with <, <=, >, >=, test equality with ==, and combine conditions with &&/||.
Now write a filter expression that returns the name of every dog below.
Input:
Expected:
Step 9 of 9