Hi,
I have this query
{
dataCalculation(func: has(users.id)) {
users.id
users.friends {
~country.friends @groupby(country.id) {
countryCount: count(uid)
}
}
}
}
And in result I see
{
"data": {
"dataCalculation": [
{
"users.id": "3a0a8bff-71c5-4e5f-bac1-52db4864e870",
"users.friends": [
{
"~country.friends": [
{
"@groupby": [
{
"country.id": "abcd1",
"countryCount": 1
},
{
"country.id": "abcd2",
"countryCount": 1
}
]
}
]
},
{
"~country.friends": [
{
"@groupby": [
{
"country.id": "abcd1",
"countryCount": 1
},
{
"country.id": "abcd2",
"countryCount": 1
}
]
}
]
}
.....
Question: How can I group by elements in “@groupby”? to make result
{
"~country.friends": [
{
"@groupby": [
{
"country.id": "abcd1",
"countryCount": 2
},
{
"country.id": "abcd2",
"countryCount": 2
}
]
}
]
}