Hi all,
I have a question regarding go client’s alter method.
dc := api.NewDgraphClient(conn)
dg := dgo.NewDgraphClient(dc)
op := &api.Operation{}
op.Schema = `
sid: string @index(hash) .
key: string @index(hash) .
value: string .
type SessionEntry {
sid
key
value
}
`
ctx := context.Background()
err := dg.Alter(ctx, op)
if err != nil {
...
}
if I run the above code and the schema doesn’t exist it’ll get created.
But if the schema already exists will it stop or anyway apply the schema (consume resources for an unnecessary operation)?
Should I include a check operation prior to alter? schema(type: SessionEntry) {}
Would such check be redundant?
thanks in advance
Byron