This way you’re doing is a miss concept of how mutations work. The client will recognize the object you’re sending (the update as overwrite) if you write how Janardhan did. So You don’t need to send an object like u did. It’s seems logical, but not how mutations works.
Dgraph do not store data as Json. It’s translate it into triples stores (nquad store - RDF 1.1 N-Quads ) and vice versa. You have to always think in RFD model to deal with Dgraph.
const p = {
"uid" : "0xf9078",
"password": "xyz"
}
With this representation, our aim is to make the interaction work like documents. You can pass in the properties, along with the id of the document, and Dgraph would internally do what it needs to store them. Querying works the same way.
Thank you all it is working well. This was not clear for me because i tried to mutete a override like the documentation of dgraph and not like a document. Maybe it would be nice to include an update mutation into the example to avoid this kind of questions?