How do I use unfolded list values to specify a vertex?

狂风中的少年 提交于 2021-01-29 06:12:40
问题 I'm trying to write a Gremlin traversal meaning "add all of these identities to this group", patterning it after the "inject list" example in the recipes. This is the logic I'm attempting: List identityIds = [...] gts.inject(identityIds).unfold() .V() // filter statement goes here? .addE(GROUP_INCLUDES_IDENTITY).from(V(groupId)) .iterate() As I understand it, this will spawn a traverser for each element in the list and execute the addE operation. However, I can't figure out how to express V()

gremlin filter on Hashmap property without using a lambda

痴心易碎 提交于 2021-01-28 18:54:11
问题 If I have a vertex in a graph database where one of the properties is a map, is there a way to filter on properties of the map without using a lambda? Create the vertex like this: gremlin> v = graph.addVertex(label, 'LABEL') ==>v[68] gremlin> g.V(68).property('prop', [ key: 'val' ]) ==>v[68] gremlin> g.V(68).valueMap() ==>{prop=[{key=val}]} Is there a way to filter for vertices by prop.key == 'val' without using a lambda? gremlin> g.V().filter{ it.get().values('prop').next().get('key') ==