https://dgraph.io/tour/schema/8/
shows some options for deleting
- Delete a single triple
- Delete all triples for a given edge
- Delete all triples for a given node
Now i'd like to delete all triple for nodes of a given type. I assume this is done by some kind of combination of a query that selects the nodes for the the given type and then a mutation for each of these nodes. I couldn't find an example for this in the tutorial.
Let's assume I'd like to delete all triples for nodes of the type Country.
I know how to select the uids for the nodes:
{
query(func: has(<dgraph.type>)) @filter(eq(<dgraph.type>, "Country")) {
uid
}
}
But how do i combine this with a mutation?
https://discuss.dgraph.io/t/how-to-bulk-delete-nodes-or-cascade-delete-nodes/7308
seems to ask for an "upsert"
How could the deletion of all triples for nodes with a given type be achieved?