MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / Upsert

Method Upsert

dgraphapi/cluster.go:761–773  ·  view source on GitHub ↗
(query string, mu *api.Mutation)

Source from the content-addressed store, hash-verified

759}
760
761func (gc *GrpcClient) Upsert(query string, mu *api.Mutation) (*api.Response, error) {
762 txn := gc.NewTxn()
763 defer func() { _ = txn.Discard(context.Background()) }()
764
765 ctx, cancel := context.WithTimeout(context.Background(), requestTimeout)
766 defer cancel()
767 req := &api.Request{
768 Query: query,
769 Mutations: []*api.Mutation{mu},
770 CommitNow: true,
771 }
772 return txn.Do(ctx, req)
773}
774
775// Query performa a given query in a new txn
776func (gc *GrpcClient) Query(query string) (*api.Response, error) {

Callers 15

doQueryMethod · 0.80
RunMethod · 0.80
TestUniqueUpsertMutationFunction · 0.80
TestUniqueDeleteMutationFunction · 0.80
MonitorDiskMetricsFunction · 0.80
initFunction · 0.80
WithMethodFunction · 0.80
proposeAndWaitMethod · 0.80

Calls

no outgoing calls