[Bug] JsonPath query regression with filtering array
See original GitHub issue- Insomnia Version: 6.6.0
- Operating System: Kubuntu 18.10
Details
In the latest version, my query through a list of objects comparing/equating to a certain property doesn’t work anymore.
In my example data, my query is $.clients[?(@.id == 2049)]
In my dataset, clients is an array of objects with several properties, with id being a number. In the previous version of insomnia (i don’t remember the exact version, the previous release of 6.6.0)
Any comparison similar to the query above only returns zero results. eg. id > 2050, id < 2051 is the same with empty results.
{
"clients": [
{
"appointments": [],
"email": "client1@gmail.com",
"firstname": "client1",
"fullname": "client1 test",
"id": 2049,
"lastname": "test"
},
{
"appointments": [],
"email": "client2@gmail.com",
"firstname": "client2",
"fullname": "client2 test",
"id": 2050,
"lastname": "test"
},
{
"appointments": [],
"email": "client3@gmail.com",
"firstname": "client3",
"fullname": "client3 test",
"id": 2051,
"lastname": "test"
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
json - How to filter by string in JSONPath? - Stack Overflow
Your query looks fine, and your data and query work for me using this JsonPath parser. Also see the example queries on that...
Read more >Part 4 - JSONPath Expression for JSON Array aka List via Filters
In this video I've covered the following: -What are Filters ?Why do we need Filters ?SyntaxCommonly Used Filter OperatorsExamples.
Read more >JSON Path Expressions | Exasol DB Documentation
The function toarray() returns all SQL/JSON values identified by the path as an array. This is useful to identify paths that return more...
Read more >Experimental array.filter() function | Flux 0.x Documentation
array.filter() iterates over an array, evaluates each element with a predicate function, and then returns a new array with only elements that match...
Read more >jsonb_array_elements() fails with "ERROR: cannot extract ...
As the name suggests, jsonb_array_elements() expects a JSON array to unnest. But, according to your error message, at least one row contains a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It looks like the JSONPath dependency version may have changed by accident in the last release. Taking a look now.
As for your original problem, @jrods. Your response is invalid JSON. The array of clients is missing a closing bracket. Even after fixing that it still doesn’t work though 😦
@Ravelman v6.6.2 released yesterday had fixed this error