diff --git a/src/main/asciidoc/reference/sql/sql-create-edge.adoc b/src/main/asciidoc/reference/sql/sql-create-edge.adoc index 1f48d6b62..b1f31e60e 100644 --- a/src/main/asciidoc/reference/sql/sql-create-edge.adoc +++ b/src/main/asciidoc/reference/sql/sql-create-edge.adoc @@ -19,7 +19,7 @@ CREATE EDGE [BUCKET ] FROM |[[,]*]|() TO |[ * *`<type>`* defines the type name for the edge. * *`<bucket>`* defines the bucket in which you want to store the edge. * *`UNIDIRECTIONAL`* creates a unidirectional edge; by default edges are bidirectional. -* *`IF NOT EXISTS`* skips the creation of the edge if another edge already exists with the same direction (same from/to) and same edge type. _(Since v26.12.1)_ The check holds under concurrent writers too: of two transactions creating the same edge at the same time, the second to commit is refused with a retryable `ConcurrentModificationException`, and its retry finds the edge the first one created (see <>). In v26.11.1 and earlier, concurrent writers could store the edge more than once. +* *`IF NOT EXISTS`* skips the creation of the edge if another edge already exists with the same direction (same from/to) and same edge type. _(Since v26.12.1)_ The check holds under concurrent writers too: of two transactions creating the same edge at the same time, the second to commit is refused with a retryable `ConcurrentModificationException`, and its retry finds the edge the first one created (see <>). In v26.11.1 and earlier, concurrent writers could store the edge more than once. _(Since v26.12.1)_ On a lightweight edge type the existing edge is returned as it is; a `SET` of the statement is not applied to an edge that already exists. * *`JSON`* provides JSON content to set as the record. Use this instead of entering data field by field. + An `@in` / `@out` set through `SET` or `CONTENT` re-points the new edge, as <> does to an existing one: `CREATE EDGE F FROM #1:0 TO #1:1 SET @in = #1:2` creates an edge from `#1:0` to `#1:2`. A named record that does not exist, was deleted in the same transaction, or is not a vertex fails the statement, and no edge is stored. The same applies to an openCypher `CREATE` with an `@in` / `@out` property and to the Java `newEdge()`. _(Since v26.12.1: v26.11.1 stored an edge whose `@in` / `@out` disagreed with the vertex it was linked to, which `CHECK DATABASE FIX` then deleted, and v26.10.1 ignored the value.)_