However, I want to make a filter that returns only the nodes that have more than 2 friends of 30 years,
so it should only return to “Michael” not Amit, who has 2, nor “Sang Hyun”, who only has 1.
I don’t know if I have to use variables or it is easier than I think
Thanks for your time MichelDiz,
I’ve been running queries similar to the one you suggest. The problem is that GE as count (uid) does not seem to store anything.
I think I have a query that works.
The key is to somehow store the friends who are over 30 years old and for this I use math (1) to assign 1 to the variable gt_30 for the uid n. At the end, the values of that variable are added, which will be used to make the filter.
{
F as var (func: gt (count (friend), 1)) @cascade {
friend @filter (gt (age, 30)) { gt_30 as math(1)
}
sum_myscore as sum(val(gt_30))