Hi Dgraph community!
How do I mutate my Person in dgo, with non-scalar predicate ?
The below code works without any effect.
operation := &api.Operation{
Schema: `
type Person {
name
age
knows
}
name: string @index(exact) .
age: int .
knows: [uid] .
`,
}
query := `
query{
me( func: uid(0x2711)){
foundValue as uid
name
knows
}
}
`
mu := &api.Mutation{
SetNquads: []byte(`uid(foundValue) <knows> <0x4c> .`),
}
req := &api.Request{
Query: query,
Mutations: []*api.Mutation{mu},
CommitNow: true,
}
_, err := txn.Do(ctx, req)
if err != nil {
log.Fatal("1015 error mutation person", err)
}