when I run below query
SELECT * FROM myBucket WHERE ANY x IN transactions SATISFIES x.type in [0,4] END;
Result:
{ \"_type\"
transactions[*].amount this is return array so first need to user array function
ARRAY_SUM
than use sum like below.
SELECT sum(ARRAY_SUM(transactions[*].amount)) FROM Inheritx WHERE ANY x IN transactions SATISFIES x.type in [0,4] END;