Delete edge which object's valueType is uid

When I run dgraph server with the binaries version v0.9.4, i run the java client such as

Mutation.Builder b = Mutation.newBuilder(mu);
b.addDel(
                  NQuad.newBuilder()
                            .setSubject(uid)
                            .setPredicate(predicate)
                            .setObjectId(valueUid)            // valueUid is the Object's uid
                            .build()
).build();

the server throw an exeption such as

Exception in thread "main" io.grpc.StatusRuntimeException: UNKNOWN: Please use * with delete operation for non-list type
	at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:210)
	at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:191)
	at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:124)
	at io.dgraph.DgraphGrpc$DgraphBlockingStub.mutate(DgraphGrpc.java:298)
	at io.dgraph.DgraphClient$Transaction.mutate(DgraphClient.java:211)

but when i run dgraph with the source code , i success delete the edge use the same java code

can anyone tell me why. (is the binaries version is not use the newest source code?)

Hey @yunzhongshu

What’s the schema type for the predicate you are trying to delete? For predicates of scalar type(int/float/geo etc.) we don’t allow S P O deletion. You have to do a S P * deletion. You could use the delete edges function to achieve this.

The schema type is uid, not the scalar type, so I use the “setObjectId” not “setObjectValue”

I see, also are you sure that valueUid has a non-zero value? This error would also be thrown if valueUid is 0.

If you are still facing the issue could you create an issue on Github with some steps to reproduce please?

ok, thank for your reply

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.