exists()

How to identify that vertices or edges already exist when loading data from a data file.

Synopsis

exists()

Description

When loading edges, often the specified vertices for incoming or outgoing endpoints already exist in the database. The exists() method will identify that the vertices do not need creation when the edges are created.

The exists() method can also be used to specify that edges already exist.

Examples

Identify that the vertices for the outgoing vertices identified in the field aname in outV already exist in the database and do not need to be created:
load(authorBookInput).asEdges {
    label "authored"
    outV "aname", { 
        label "author"
        key "name"
        exists()
    }
    inV "bname", {
        label "book"
        key "name"
    }
}