{
"type": "order",
"discount":"freeShipping",
"products": [
{
"sku": "90897",
"qty": 3,
"price": 1.99
}
]
}
This SQL++ works:
SELECT * FROM dataset AS a WHERE ANY x IN a.products SATISFIES x.qty > 0 END
but as soon as you put in an additional where predicate you’ll get an error like below.
SELECT * FROM bucket as a WHERE ANY x IN a.products SATISFIES x.qty > 0 END AND discount = "freeShipping"
BUT if you add round brackets ( … ) around the array loop it works.
SELECT * FROM bucket as a WHERE (ANY x IN a.products SATISFIES x.qty > 0 END) AND discount = "freeShipping"