example:
There are 5 entities:a,b,c,d,e.
a like b
c like b
c like e
How to find the entities that not like b?
have you tried using @cascade ?
I am assuming all entities have a name, if not you could use some other predicate for has.
{
allEntities as var(func: has(name)) @filter(NOT eq(name, "b"))
likeB as var(func: uid(allEntities)) @cascade {
name
like @filter(eq(name, "b"))
}
# Subtract those who like B from all entities.
me(func: uid(allEntities)) @filter(NOT uid(likeB)) {
name
}
}
index consume so many time while putting too many data into dgraph, but function should be used in some predicates which have been indexed, i am in trouble now.
Sorry, I'm not following the concern here, @shanghai-Jerry .
@pawanrawal Thanks,Will this lead to full tables scan?
allEntities as var(func: has(name)) @filter(NOT eq(name, "b"))
This would lead to a scan over the keys of predicate name. Key scans are really fast though. This isn't a bug, but questions. So, closing the issue.
Most helpful comment
I am assuming all entities have a name, if not you could use some other predicate for
has.