1 Answer
- Newest
- Most votes
- Most comments
0
While there is not enough information to determine what happened here, and since two nodes were created with different ID values the most likely culprit was something inside your Java application called the CREATE
query multiple times, maybe as part of retry logic. If you want to ensure that a value is only added a single time, you should investigate using the MERGE
clause, which will perform an upsert operation based on the matching criteria you specify. In the example below, I am matching on UniqueId
MERGE (n:Person)
WHERE UniqueID=$uniqueId
ON CREATE
SET n = {firstName: $firstName,lastName: $lastName,dateCreated: $dateCreated,UniqueID: $uniqueID }
answered a year ago
Relevant content
- Accepted Answerasked 4 years ago
- Accepted Answerasked 5 months ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago