{
"a": 42,
"b": [true, null]
}
But we also have functions, subqueries, joins, and so on: {
"allArticles": *[_type == "article"]
}
Here, the asterisk simply means the array of "all objects", and [] is used to apply a filter predicate.To me, I don't find Jq at all intuitive. The fact that filtering a collection is expressed this way, for example:
.[] | select(.type == "article")
is not "intuitive", because it doesn't look like anything else. The pipe operator certainly behaves very differently from Unix shells; it's the "[]" part that causes iteration, not the pipe.I absolutely see your point about abstracting away complexity. Developers have a lot of knowledge in their heads about how SQL translates to execution complexity, and GROQ is more opaque. We do have an "explain" mode that shows the query plan, but we are still thinking about ways to make the execution model more transparent and understandable.