Filtering using two predicates when they are equal

I have two nodes a and b, a and b both has fields temp(string value) also b is connected to a. now I want to filter the uid values of b when b.temp is equal to a.temp.

when I am using the filter this way it isn’t giving me the results.

a.b@filter(eq(b.temp, a.temp)){

what could be the possible solution for this?

can someone please reply on this!