Check the dgo readme file, it contains several examples: https://github.com/dgraph-io/dgo#running-an-upsert-query--mutation