deep filtering json/jsonb data
See original GitHub issuehttps://docs.hasura.io/1.0/graphql/manual/api-reference/graphql-api/query.html#simple-object
The documentation seems to missing information or I am going about it the wrong way… probably the later 😃
I have a table with “id” and “data” being jsonb.
I cant see how to query for “order_id”
{
tasks(where: {data: { ? }}) { // "order_id" _eq: 123456
data
}
}
Also how do I return all the task names?
Is it also necessary to do data(path: "")
for every single field I want? Seems rather repetitive.
{
tasks {
order_id: data(path: "order_id")
tasks_names: data(path: "tasks.name") // fails NULL
tasks_names1: data(path: "tasks[*].name") // fails
}
}
Below is the data structure.
{
"data": {
"tasks": [
{
"data": {
"owner": "me",
"tasks": [
{
"name": "task 1",
"actioned": "yes"
},
{
"name": "task 2",
"actioned": "no"
},
{
"name": "task 3",
"actioned": "yes"
}
],
"order_id": 123456
}
},
{
"data": {
"owner": "me",
"tasks": [
{
"name": "task 1",
"actioned": "no"
},
{
"name": "task 2",
"actioned": "no"
},
{
"name": "task 3",
"actioned": "no"
}
],
"order_id": 654321
}
}
]
}
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:15 (4 by maintainers)
Top Results From Across the Web
Querying JSON (JSONB) data types in PostgreSQL
These operators work on both JSON as well as JSONB columns. Because the -> operator returns an object, you can chain it to...
Read more >Faster Operations with the JSONB Data Type in PostgreSQL
Lucero Del Alba takes a look at how to get better performance out of jsonb data types in PostgreSQL in this Compose's Write...
Read more >Javascript implement deep filtering in nested json data
I look at lodash but it does not seem to have a deep filter. I am now thinking about using a tree traversal...
Read more >Deep Filtering: Signal Extraction and Reconstruction Using ...
Signal extraction from a single-channel mixture with additional undesired signals is most commonly performed using time-frequency (TF) masks.
Read more >How to Filter Results on Deeply Nested fields in Strapi
Learn about different ways to deeply filter results using ... Some dummy data will help us explore different approaches in a practice way....
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
postgres 12 added jsonpath, which gives postgres solid NoSQL capabilities. You can even index the json like a boss: for example
"rooms.*.id"
“JSON/B” is a first-class citizen in Postgres now.Adding support for “jsonpath” as a filter option would be great!
Any plan in roadmap about support json path in query?