Set_json support

Hello,

I do not understand how to use set_json as to indicate in the wiki (https://docs.dgraph.io/mutations/#setting-literal-values).

With Ratel (on HTTP port) I have an error “empty mutation” when using

{“set_json”:
{
“name”: “Alice”
}
}

while

{“set”:
{
“name”: “Alice”
}
}

works!

I wonder if set_json is really supported in 1.0.7. That would explain why the JavaClient which generates set_json syntax too (with a Mutation.newBuilder().setSetJson().build() on gRPC port) answers me “io.grpc.StatusRuntimeException: ABORTED: Transaction has been aborted”

PS: Update: Using JSON to mutate on Dgraph. (cURL, Raw HTTP) examples use set syntax too :confused:

set_json is an operation used by clients (native), So this syntax you are confusing is via HTTP Raw tho
https://docs.dgraph.io/mutations/#json-syntax-using-raw-http-or-ratel-ui

Thank you, It allowed me to understand that the error produced by my Java code didn’t come from the use of set_json by native Java client.
In fact, I forgot (!) to commit the transaction and it is the normal message of the discard contained in the finally clause…
Sorry

1 Like

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