Mutating data without needing to get it back
This commit is contained in:
parent
f61fe566a5
commit
fb270a1b66
|
@ -3,7 +3,6 @@ package plugins
|
|||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"github.com/CaliDog/certstream-go"
|
||||
|
@ -89,26 +88,25 @@ func (c *CertStreamPlugin) doRun(graphClient *dgo.Dgraph) {
|
|||
logrus.Fatal(err)
|
||||
}
|
||||
mu.SetJson = marshaled
|
||||
assigned, err := graphClient.NewTxn().Mutate(context.Background(), mu)
|
||||
_, err = graphClient.NewTxn().Mutate(context.Background(), mu)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
variables := map[string]string{"$id": assigned.Uids[mainNode.ID]}
|
||||
q := `query Node($id: string){
|
||||
node(func: uid($id)) {
|
||||
uid
|
||||
ID
|
||||
Type
|
||||
Data
|
||||
Created
|
||||
Modified
|
||||
}
|
||||
}`
|
||||
resp, err := graphClient.NewTxn().QueryWithVars(context.Background(), q, variables)
|
||||
if err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
fmt.Println(resp)
|
||||
// variables := map[string]string{"$id": assigned.Uids[mainNode.ID]}
|
||||
// q := `query Node($id: string){
|
||||
// node(func: uid($id)) {
|
||||
// uid
|
||||
// ID
|
||||
// type
|
||||
// data
|
||||
// dreated
|
||||
// modified
|
||||
// }
|
||||
// }`
|
||||
// _, err := graphClient.NewTxn().QueryWithVars(context.Background(), q, variables)
|
||||
// if err != nil {
|
||||
// logrus.Fatal(err)
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue