diff --git a/backend/memgraph/create_person.go b/backend/memgraph/create_person.go index e9124c7..9c146ac 100644 --- a/backend/memgraph/create_person.go +++ b/backend/memgraph/create_person.go @@ -4,6 +4,7 @@ import ( "fmt" "time" + "github.com/google/uuid" "github.com/neo4j/neo4j-go-driver/v5/neo4j" "golang.org/x/net/context" ) @@ -19,6 +20,8 @@ func (p *Person) CreatePerson(driver neo4j.DriverWithContext) (*neo4j.Record, er return nil, err } + p.ID = uuid.New().String() + query := fmt.Sprintf("CREATE (n:Person {%s}) RETURN n;", p.ToString()) result, err := session.Run(ctx, query, nil)