I ran the following mutation in Ratel on my local machine, localhost:8080
{
set {
<_:test> <name> 'test'.
<_:test_1> <name> 'test_1'.
<_:test> <rel> <_:test_1>
}
}
Assume dgraph assigns uid 0xabc11 to _:test
Next I ran the mutation:
{
delete{
<0xabc11> * * .
}
}
when I query
{
test(func: uid(0xabc11)){
uid
rel {
uid
}
}
}
I found that _:test is still connected to _:test_1
what is the correct way of delete both the predicate and the edge at the same time?
Update: After further testing I notice that the delete pattern <uid> * * . is not working on my localhost. I am not sure why.
Mutation Delete:
<uid> <rel> * . Works
<uid> <name> * . Works
<uid> * * . Doesn't work
Update 2: So i tested the query:
{
tree(func:uid(0xabc11))
{
_predicate_
expand(_all_) {}
}
}
It returns nothing… no predicates no edges
But the query:
{
tree(func:uid(0xabc11))
{
name
}
}
returns the name that was supposed to be deleted?
Update 3: I even tried using the JSON format “delete”:[{“uid”:“0xabc11”}] but it still has the name when queried.
I feel like I am missing something really basic here.