Adding property data

To change the value of property data for a particular vertex, use the property() step. Each property changed must have its own property() step.

  • If a property value has been dropped in order to change the value, a new value can be written. This example illustrates adding the value M to the author vertex with the name James Beard.

     g.V().has('author','name','James Beard').property('gender', 'M')
    gremlin> g.V().hasLabel('author').valueMap()
    ==>{gender=[F], name=[Julia Child]}
    ==>{gender=[F], name=[Patricia Curtan]}
    ==>{gender=[F], name=[Kelsie Kerr]}
    ==>{gender=[F], name=[Simone Beck]}
    ==>{gender=[F], name=[Alice Waters]}
    ==>{gender=[F], name=[Patricia Simon]}
    ==>{gender=[M], name=[James Beard]}
    ==>{name=[Fritz Streiff]}
    ==>{name=[Emeril Lagasse]}
    ==>{gender=[F], name=[Louisette Bertholie]}

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