How can we add type to a node while storing it in dgraph with dgraph4j client?
In the code, while adding a node, where we are converting object to JSON and using setSetJson method of Mutation class to add data to dgraph.
private boolean setData(final String personJson) {
Mutation mutation = Mutation.newBuilder()
.setSetJson(ByteString.copyFromUtf8(personJson))
.build();
try (Transaction txn = clients.newTransaction()) {
txn.mutate(mutation);
txn.commit();
return true;
}
}
when using setSetJson method, it is not able to add dgraph.type to the node.
So, is there any way to add type to the node?