As specified in the pydgraph mutation docs, you can run mutations in pydgraph in either JSON format (as a dict) or NQuad format using Txn#mutate(set_obj=mutation_dict) or and Txn#mutate(set_nquads=nquads_str) respectively.
I’m not sure this syntax works. I tried it myself and the mutation did not succeed. Edit: I edited your original post to format your mutation in a code block to show everything (<name> got removed since it was treated as HTML tags that needed to be sanitized). Your mutation works as expected.
Hey @Linfei, since this post is already marked as solved, could you please open a new topic with details of all the steps you performed and the version of dgraph, pydgraph and/or ratel you are using?