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




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.


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"
    inV "bname", {
        label "book"
        key "name"

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com