Example:
{
delete {
<0x1> <_follows> <0x2> .
}
}
use DgraphClient excute
I invoke as follows
@Test
public void deleteEdge(){
String operatJson =
"\t{\n" +
"\t\tdelete {\n" +
"\t\t\t<0x1> <follows> <0x2> .\n" +
"\t\t}\n" +
"\t}";
DgraphProto.Mutation mutation = DgraphProto.Mutation.newBuilder()
.setDeleteJson(ByteString.copyFromUtf8(operatJson)).build();
Transaction txn = dgraphClient.newTransaction();
txn.mutate(mutation);
txn.commit();
}
but it throw Exception
Caused by: java.util.concurrent.ExecutionException: io.grpc.StatusRuntimeException: UNKNOWN: invalid character ‘d’ looking for beginning of object key string
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
at io.dgraph.DgraphAsyncClient.lambda$runWithRetries$2(DgraphAsyncClient.java:180)
… 7 more