[英]How to update several vertices with same property in Gremlin
I have a set of vertices which have the same property 'TYPE'. 我有一组具有相同属性'TYPE'的顶点。 How to update this property for all the given set of vertices.
如何为所有给定的顶点集更新此属性。
You can iterate through all your vertices and update their type property using a sideEffect. 您可以使用sideEffect迭代所有顶点并更新其type属性。 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: 或者......在纯Groovy中:
mySetOfVertices.each{ it.setProperty('TYPE',newTypeValue) }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.