uuid to memgraph compatible

This commit is contained in:
2024-04-18 23:08:52 +02:00
parent bc7cf7f1a6
commit cf4b79c593

View File

@@ -2,8 +2,10 @@ package memgraph
import (
"fmt"
"strings"
"time"
"github.com/google/uuid"
"github.com/neo4j/neo4j-go-driver/v5/neo4j"
"golang.org/x/net/context"
)
@@ -19,6 +21,8 @@ func (rp *RelationshipAndPerson) CreateRelationshipAndPerson(driver neo4j.Driver
return nil, err
}
rp.Person.ID = strings.ReplaceAll(uuid.New().String(), "-", "")
query := fmt.Sprintf(`MATCH (a:Person) WHERE a.ID = %s`, rp.Relationship.FirstPersonID)
query = fmt.Sprintf("%s CREATE (b:Person {%s})", query, rp.Person.ToString())