QuickStart Writing and reading data

Writing and reading graph data.

About this task

Writing data from DataStax Graph to a file is most easily accomplished with the g.io() command.

Procedure

  1. Write your data to an output file to save or exchange information using the GraphSON format, a variation of JSON:

    g.io("/tmp/food_qs.json").write()

    g.io() is disabled in sandbox mode.

    In Studio:

    GSStudioWriteGraphSON
  2. Read your data from an output file to exchange information using the GraphSON format:

    g.io("/tmp/food_qs.json").read()

    In Studio:

    GSStudioReadGraphSON

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