HI I have document like:
"name": "Test",
"items": [{
"id": "1427",
"sellers": 12,
"active": "yes",
}, {
"id": "132",
"sellers": 12,
"active": "no",
}, {
"id": "1711",
"sellers": 12,
"active": "yes",
}],
lets say I want to select all documents like this from some namespace
SELECT * FROM bucket_name WHERE `_ns` = "items"
but also I would like to return additional counter which will reflect how many items are active something like this:
SELECT *, COUNT(SELECT * FROM ANY i IN items WHERE i.active = "yes") as counter FROM bucket_name WHERE `_ns` = "items"
but I can’t find solution can someone help me thanks