MCPcopy Create free account
hub / github.com/dgraph-io/dgraph / TestUpsertEmptyUID

Function TestUpsertEmptyUID

dgraph/cmd/alpha/upsert_test.go:2000–2027  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1998}
1999
2000func TestUpsertEmptyUID(t *testing.T) {
2001 SetupBankExample(t)
2002 m1 := `
2003upsert {
2004 query {
2005 var(func: has(amount)) {
2006 amt as amount
2007 }
2008 me() {
2009 max_amt as max(val(amt))
2010 }
2011 v as q(func: eq(name, "Michael")) {
2012 amount
2013 }
2014 }
2015
2016 mutation {
2017 set {
2018 uid(v) <amount> val(max_amt) .
2019 }
2020 }
2021}`
2022 mr, err := mutationWithTs(mutationInp{body: m1, typ: "application/rdf", commitNow: true})
2023 require.NoError(t, err)
2024 result := QueryResult{}
2025 require.NoError(t, json.Unmarshal(mr.data, &result))
2026 require.Equal(t, 0, len(result.Queries["q"]))
2027}
2028
2029func TestUpsertBulkUpdateBranch(t *testing.T) {
2030 require.NoError(t, dropAll())

Callers

nothing calls this directly

Calls 2

SetupBankExampleFunction · 0.85
mutationWithTsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…