Closed marktani closed 2 years ago
would it be possible to filter on Json columns? maybe for just testing if empty or null?
allRecords(filter:{ jsonColumn_empty: true}){ ... }
Could Algolia be used for querying JSON fields?
Add JSON
support using dot notation. Could require depth or exact flat map in the field's settings to limit search.
// Example JSON
{
"some": {
"deep": {
"value": 99
},
"nested": [
{
"value": 88
},
{
"value": 77
}
]
}
}
// Filter obj
query {
allPosts(filter: {
jsonFieldName.some.deep.value_gte : 23
}
}) {
id
}
}
// Filter array
query {
allPosts(filter: {
jsonFieldName.some.nested {
value_gte : 23
}
}
}) {
id
}
}
Is this feature still on horizon? Or Would the Implementation for "Interface types" #83 cover this feature?
This is something I'm interested in. But I also think we could start iteratively.
First, I think there needs to be a way to query scalar list fields and Json type fields for whether or not they are null (or unset or emtpy). Maybe something like this:
query {
allPosts(where: {
myJsonField_null: true
}) {
id
}
}
Or maybe just providing a raw strict equality and that way you could use the NOT query if you want or even do strict comparison of one JSON value to another.:
query {
allPosts(where: {
myJsonField: null
}) {
id
}
}
This seems like something that I hope could happen sooner rather than later without needing to decide on a whole schema for deep Json field queries.
Is there any estimated date for this feature? We really need this!!
hey! We're also desperately waiting for this to be implemented! @marktani is this still on the roadmap?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.
Any advice on this feature?
Given this mongo schema,
var instanceSchema = new mongoose.Schema({
name: String,
data: Array
});
I can push data like below,
var example = new Instance({
name: "Example.com",
data: [
{"Property 1": "Example.com"},
{"Property 2": "Something else"},
]
});
And query like this,
Instance.findOne({
name: "Example.org",
"data.2.Property 3": "Something else 3"
})
I cannot find any way to get similar result with prisma/graphql.
I ended up creating my own filter using mingo, but I suppose prisma can implement it somewhere and abstract it away.
I needed a solution to filter schemaless Json data (array of objects). So there were two path for me. Either create a schema on the fly, or add some filters manually.
If anyone want's to see the minimal implementation I did for JSON filter, check my playground-json-query-mingo repo.
All suggestions are welcome.
Simple filter:
Complex filter:
Any solution ?
any solution?
The ability to filter a node based on the keys or values of a JSON field. Suggestion: