Given:
A -[children]> B
A -[children]> C
I want to be able to query for A and only return if:
B.node_key = "b"
C.node_key = "c"
I can’t manage to figure out how to do an “AND” on an edge. Like, A must have an edge ‘children’ to a node that has a value ‘node_key=b’ AND it must have an edge to a node that has a value ‘node_key=c’.
{
var(func: eq(node_key, evil_0)) @cascade {
v0 as uid,
dgraph.type,
c0 as children @filter(eq(node_key, "evil_1")) {
uid, dgraph.type, process_name
}
}
var(func: eq(node_key, evil_0)) @cascade {
v1 as uid,
dgraph.type,
c1 as children @filter(eq(node_key, "evil_3")) {
uid, dgraph.type, process_name
}
}
var(func: uid(v0, v1)) @cascade
@filter(uid(v0) AND uid(v1))
{
co as uid,
}
q(func: uid(co))
{
uid,
dgraph.type,
children @filter(uid(c0, c1))
{
uid, dgraph.type, process_name
},
}
}
Here’s an example I’ve tried. I just can’t figure out how to say that both children must exist.