How to specify a property from a traversal.


  .[ property ('property\_key') ... ]


The property() step is a sideEffect. When a vertex is added from a traversal g using addV, properties can be added with property(). For a previously created vertex, properties can be added. A previously created vertex label must be specified. Property key-value pairs are specified.


Create a vertex with a vertex label person with the properties personId with value 17and name with value Jamie Oliver:

   property('personId', 17).
   property('name','Jamie Oliver').next()

Add the properties gender with value M and nickname with value jimmy to a person vertex previously created:

g.V().has('person', 'name', 'Jamie Oliver').
   property('gender', 'M').
   property('nickname', 'jimmy')

Add the property withSuppliedId with value 341f9950-997c-11e7-9579-7f50358d3f8d to a person vertex:

// user-supplied property ID
   property('withSuppliedId', 'propValue',, UUID.fromString('341f9950-997c-11e7-9579-7f50358d3f8d'))

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,