Open Gozala opened 6 months ago
Defaulting to universal quantification has been universally (ha!) preferred 👍
@QuinnWilton had a good phrasing for why:
In database queries, you want to filter out all counterexamples. In validation, you want to know that there are no counterexamples [Paraphrased]
When asked about which was preferred:
["some", ".foo.bar.[]", "?x"]
[">", "?x", 0]
["in", ".foo.bar.[]", "?x"]
[">", "?x", 0]
["any", ".foo.bar.[]", "?x"]
[">", "?x", 0]
["exists", ".foo.bar.[]", "?x"]
[">", "?x", 0]
some
was the favourite by strong preference. It makes an analogy to JS's .some()
function, plus in logic you say "there exists some x where ...", so it works for that crowd, too
We had various sketches and discussions around how to support
some
notation. To be honest I am not sure we need dedicated syntax because[]
in the selector effectively gives you that.On the other hand I also argue in #5 that jq is little ambiguous there and perhaps it would make more sense to do something like this instead
Which is same as this (with a current selector syntax