The code written below should check if a match is present, if so it should update the value.
Otherwise it should create a node with the given value.
Currently every time I update a organization.Role value it creates an entirely new node.
Even when the organization.Role value is not changed.
So technically 60 seller nodes could be added.
There should only be one role node per organization and its value should just be changed.
I've not been able to figure out why the current behavior happens as stated above.
query = query.Merge("(role:Role {roletype: $newRoleValue})")
.OnCreate()
.Set("role = $newRole")
.WithParam("newRole", new { Name = newTenderVersion.Organization.Role.ToString() })
.WithParam("newRoleValue", newTenderVersion.Organization.Role.ToString())
.Merge($"(organization)-[:HAS_ROLE]->(role)");