How to filter result after groupby

eg:
{
result(func: type(Person)) @groupby(age){
count(uid)
}
}

i want to filter count(age) > 5

Impossible to know exactly what’s going on without more information. But usually this sort of multiple filtering and aggregation operations requires blocks. I refer you to Dgraph’s tour of DQL, which covers this sort of operation: Query Variables | Blocksvars | Dgraph Tour