I have a set of vertices which have the same property 'TYPE'. How to update this property for all the given set of vertices.
Asked
Active
Viewed 1,252 times
1 Answers
8
You can iterate through all your vertices and update their type property using a sideEffect. For example:
g.V.sideEffect{it.setProperty('TYPE',newTypeValue)}.iterate()
If you have a predefined set of vertices, you can do this:
mySetOfVertices._().sideEffect{it.setProperty('TYPE',newTypeValue)}.iterate()
Or...in pure Groovy:
mySetOfVertices.each{ it.setProperty('TYPE',newTypeValue) }

Andrew Barber
- 39,603
- 20
- 94
- 123

Marko A. Rodriguez
- 1,702
- 12
- 13
-
Thanks for your quick response Marko. Will post back if i find any problems. – Shireesh Feb 23 '12 at 09:15
-
Is there an advantage to the Gremlin form, or to the pure Groovy form? – PaulMcG Oct 04 '14 at 05:39