AND / OR support
Author: nkevCreated Sep 4, 2026Updated Sep 4, 2026
Given the following JSON:
[{
"name": "Acme1",
"type": "company",
"country": "Australia"
},
{
"name": "John",
"type": "user",
"country": "Australia"
},
{
"name": "David",
"type": "user",
"country": "New Zealand"
}]AND Operator
Currently, I can get all objects where country=="Australia" AND type="user" with below query, but it's a two-pass scan:
#(country=="Australia")#|#(type=="user")#OR Operator
As far as I can see, there is no single query to get all objects where country=="Australia" OR country="New Zealand"
Can support be added for intuitive single-pass AND / OR operations, like this:
Get all users in Australia:
#(country=="Australia" && type=="user")#Get all users in Australia or New Zealand:
#( type=="user" && (country=="Australia" || country=="New Zealand") )#Source: tidwall/gjson