g.V(1).as("a").out("knows").values("age").fold(select("a").by("age"), sum)
gremlin> g.V(1).as("a").union(identity(), out("knows")).values("age").sum()==>88
--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/9baee25d-f29c-4c51-9aea-7ac69c585a98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Why not simplify your query and just use sum()? E.g. instead ofg.V(1).as("a").out("knows").values("age").fold(select("a").by("age"), sum)...you could do:gremlin> g.V(1).as("a").union(identity(), out("knows")).values("age").sum()==>88Cheers,Daniel
On Fri, Oct 13, 2017 at 9:56 AM, Bailey Glen <baile...@gmail.com> wrote:
How do you provide an initial value to fold that is derived from the traversal. For instanceg.V().values('pval').flatmap(_as('cur_val').union(flatMap( <generate some value>)).fold(select('cur_val'), sum))
--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
Is it possible to have the initial fold value derived from the graph?
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/5ecc7fa5-ccc3-464e-a17c-efa94095d61e%40googlegroups.com.