emit

Emit traversers before or after a repeat() step.

Synopsis

emit( [ 'predicate' | 'traversal' ])

Description

The emit() step is a step modulator, a helper step for another traversal step. Its main use is to emit either incoming traversers before a repeat() step, or emit outgoing traversers after a repeat() step. The emission sends a copy of the current objects to the next step in the query. A predicate or traversal can be used in an emit() step to cause the emission only if the predicate or traversal is true.

Examples

g.V(1).emit().repeat(out()).times(2).path()
==>[v[1]]
==>[v[1],v[3]]
==>[v[1],v[2]]
==>[v[1],v[4]]
==>[v[1],v[4],v[5]]
==>[v[1],v[4],v[3]]
gremlin> g.V(1).repeat(out()).times(2).emit().path()
==>[v[1],v[3]]
==>[v[1],v[2]]
==>[v[1],v[4]]
==>[v[1],v[4],v[5]]
==>[v[1],v[4],v[3]]

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