Open krlawrence opened 2 years ago
Other examples could include complex list manipulation such as
gremlin> g.V(1,2,3).values('city').fold().sack(assign)
==>[Atlanta,Anchorage,Austin]
gremlin> g.V(1,2,3).values('city').fold().sack(assign).sack()
==>[Atlanta,Anchorage,Austin]
gremlin> g.V(1,2,3).values('city').fold().sack(assign).V(4).union(values('city'),sack().unfold()).fold().sac
k(assign).sack()
==>[Nashville,Atlanta,Anchorage,Austin]
Gremlin currently does not provide a way for a sack to contain multiple values. You can do it using a map, but it gets a bit messy. It would be good to have an example in the book that shows how to work around this. Such as, given the following graph:
We could work with two sets of edge properties as follows
Which produces