Dropping graphs

Graphs can be dropped (deleted) . All schema and data for the graph will be lost, so be sure that you intend to remove a graph before using the steps below. Best practice is to truncate a graph before removing it, for better performance.

Graphs use many tables in the storage system. If a graph is no longer in use, drop it to ensure that you stay within the acceptable limit of the number of tables.

For information for dropping Classic graphs, see Dropping Graphs in DSE Graph version 6.7.

Procedure

  • Optional: If unsure of the graph name, examine what graphs exist.

  • Truncate the graph before dropping it:

    system.graph('food').
      ifExists().
      truncate()

    Use the ifExists() step to check if a graph exists before truncating.

    ==>OK
  • Drop the desired graph by running the drop() command:

    system.graph('food').
      ifExists().
      drop()

    Use the ifExists() step to check if a graph exists before dropping.

    ==>OK

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