Dear All,
Need help for this kind of example.
suppose i have documeny like this:
{“id”:“country1”,“name”:“United State”,“type”:“country”},
{“id”:“country2”,“name”:“Canada”,“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”:“card1”,“printed”:“YES”,“type”:“card”,“member”:“member1”},
{“id”:“card2”,“printed”:“YES”,“type”:“card”,“member”:“member2”},
{“id”:“card3”,“printed”:“NO”,“type”:“card”,“member”:“member3”}
the goals is, i want to have the total result like:
{ “country”:“United State”, “printed”:“YES”,“total”:2},
{ “country”:“United State”, “printed”:“NO”,“total”:1},
{ “country”:“Canada”, “printed”:"",“total”:0}
i already make index for each of the id and type and i still want to show canada even that it does not have any data.
please help how the query should be. Thanks
Regards,
Rizal