Dear Team,
Actually this is the expanded from my previous topic that already solved.
n1ql join from 3 different type document
but right now the situation like this:
assuming i have this kind of document:
{“id”:“country1”,“name”:“United State”,“type”:“country”},
{“id”:“country2”,“name”:“Canada”,“type”:“country”}
{“id”:“country3”,“name”:“United Kingdom”,“type”:“country”}
{“id”:“member1”,“name”:“Mike”,“type”:“member”,“country”:“country1”},
{“id”:“member2”,“name”:“Susan”,“type”:“member”,“country”:“country1”},
{“id”:“member3”,“name”:“Brian”,“type”:“member”,“country”:“country1”}
{“id”:“member4”,“name”:“Megan”,“type”:“member”,“country”:“country3”}
{“id”:“card1”,“printed”:“YES”,“type”:“card”,“member”:“member1”},
{“id”:“card2”,“printed”:“YES”,“type”:“card”,“member”:“member2”},
{“id”:“card3”,“printed”:“NO”,“type”:“card”,“member”:“member3”}
{“id”:“card4”,“printed”:“YES”,“type”:“card”,“member”:“member4”}
for now the goals is to show the data like:
{ “country”:“United State”, “printed”:“YES”,“total”:2},
{ “country”:“United State”, “printed”:“NO”,“total”:1},
{ “country”:“Canada”, “printed”:“YES”,“total”:0}
{ “country”:“Canada”, “printed”:“NO”,“total”:0}
{ “country”:“United Kingdom”, “printed”:“YES”,“total”:1},
{ “country”:“United Kingdom”, “printed”:“NO”,“total”:0}
can we make the result like example above? so even if the country does not have any member, stil show the printed yes and no with zero value, and also like united kingdom that only have 1 member that printed yes, but the printed no still show with the value 0.
i’m using Couchbase Enterprise Edition 5.0.1 build 5003. please help
regards,
rizal