0
를 사용하여 JSON와 내부 요소를 합계를내가 쿼리 아래 실행할 때 N1QLCouchbase
SELECT * FROM myBucket WHERE ANY x IN transactions SATISFIES x.type in [0,4] END;
결과 :
{
"_type": "Company",
"created": "2015-12-01T18:30:00.000Z",
"transactions": [
{
"amount": "96.5",
"date": "2016-01-03T18:30:00.000Z",
"type": 0
},
{
"amount": "483.7",
"date": "2016-01-10T18:30:00.000Z",
"type": 0
}
]
}
내가 얻을이
SELECT sum(transactions[*].amount) FROM Inheritx WHERE ANY x IN transactions SATISFIES x.type in [0,4] END;
결과와 같은 여러 JSON : [ { "$ 1": null } ]
지금 나는이 모든 것을 합치기를 원합니다. 내가 어떻게 해?