Would it possible to have an N1QL which would return a result set ( still maintaining same hierarchy ) considering only Active nodes
Result set if we do not pass any status in query will be same as above
However if status is passed as “ACTIVE” then response would look like
Select whole document and reconstruct ARRAY with required info then alias with original name ( In object field names are unique, Projection alias overwrites previous one when used by (.*), NOTE: Explicit duplicate alias in projection is not allowed).
ARRAY v FOR v IN b.childs WHEN v.status != "INACTIVE" END AS childs
FROM mybucket AS b