I am using the Python DGraph client because I need to batch transactions atomically, and that’s the only way I can figure out how to do it.
I have figured out how to add/query, but I am looking at updating an object. I am looking at this comment as an example but I have been using the js object format and I’m not sure how I should be doing this.
For example, to add I have been doing this.
addState = {
"uid" : "_:newNode",
"State.num": 2001,
"dgraph.type": "State"
}
txn = client.txn()
res = txn.mutate(set_obj=addState)
txn.commit()
txn.discard()
I want to update a state where the num = X and change some fields.