# Set\_json support

**URL:** <https://discuss.dgraph.io/t/set-json-support/3047>\
**Category:** Users\
**Created:** [August 22, 2018, 10:00am UTC](https://discuss.dgraph.io/t/set-json-support/3047 "2018-08-22T10:00:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![raymondBourges](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/raymondbourges/32/1213_2.png) [@raymondBourges](https://discuss.dgraph.io/u/raymondBourges)\
**Post date:** [August 22, 2018, 10:00am UTC](https://discuss.dgraph.io/t/set-json-support/3047/1 "2018-08-22T10:00:41Z")

</div>

Hello,

I do not understand how to use set\_json as to indicate in the wiki ([https://docs.dgraph.io/mutations/#setting-literal-values](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)](http://discuss.hypermode.com/t/update-using-json-to-mutate-on-dgraph-curl-raw-http/2863) examples use set syntax too 😕

---

<div class="post-metadata">

**Author:** ![MichelDiz](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/micheldiz/32/11873_2.png) [@MichelDiz](https://discuss.dgraph.io/u/MichelDiz)\
**Post date:** [August 22, 2018, 12:59pm UTC](https://discuss.dgraph.io/t/set-json-support/3047/2 "2018-08-22T12:59:29Z")

</div>

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](https://docs.dgraph.io/mutations/#json-syntax-using-raw-http-or-ratel-ui)

---

<div class="post-metadata">

**Author:** ![raymondBourges](https://yyz1.discourse-cdn.com/flex007/user_avatar/discuss.dgraph.io/raymondbourges/32/1213_2.png) [@raymondBourges](https://discuss.dgraph.io/u/raymondBourges)\
**Post date:** [August 22, 2018, 2:29pm UTC](https://discuss.dgraph.io/t/set-json-support/3047/3 "2018-08-22T14:29:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex007/uploads/dgraph/original/2X/2/2b38fdece2abe5814f2e51bee69d1e67fc304b0a.png) [@system](https://discuss.dgraph.io/u/system)\
**Post date:** [September 21, 2018, 2:30pm UTC](https://discuss.dgraph.io/t/set-json-support/3047/4 "2018-09-21T14:30:00Z")

</div>

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