Thirumal
Thirumal

Reputation: 9646

How to add vertex id as property in Gremlin

Due to an application design fault, I need to add vertex_id as the property of the vertex. How to do that in Gremlin Query?

Upvotes: 0

Views: 94

Answers (1)

Thirumal
Thirumal

Reputation: 9646

Found it! The below query is working....

g.V().hasLabel('user').as('user').V().hasLabel('user')
.where(eq('user')).as('u_id').property('user_id', select('u_id').id())

Upvotes: 0

Related Questions