r=g.E.hasLabel('route').values('dist').max().next()
g.E.hasLabel('route').as('e').dist.max.select('e').id
r=g.E.hasLabel('route').values('dist').max().next()
g.E().has('dist',r).bothV().code
r=g.E().hasLabel('route').as('e').order().by('dist', decr).limit(1).select('e').id().next()
g.E(r).dist // The distance
g.E(r).bothV.code // The airport codes
g.E().hasLabel("route").order().by("dist", decr).limit(1).bothV()
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/460554a5-f78c-455c-9638-959d13d2d95c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/19391123-4da1-44a9-b860-d025782408a3%40googlegroups.com.
gremlin> g.V().outE().as('e').values('weight').path()
==>[v[1], e[9][1-created->3], 0.4]
==>[v[1], e[7][1-knows->2], 0.5]
==>[v[1], e[8][1-knows->4], 1.0]
==>[v[4], e[10][4-created->5], 1.0]
==>[v[4], e[11][4-created->3], 0.4]
==>[v[6], e[12][6-created->3], 0.2]
gremlin> g.V().outE().as('e').values('weight').max().path()
==>[1.0]
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/a4c2688c-2a7e-4f29-ab7f-e6d8369d80cc%40googlegroups.com.
g.V().outE().as('e').values('weight').max().path()
FWIW, I think from an end users point of view it would be nice if what I had initially tried, as it seemed consistent with other things I had learned to do with Gremlin that involve using select() to go back in the path had worked after a max(). Given the gap between that and what it ultimately took with Daniel's help to get to a query that worked I think it is doubly important, that if possible, from an end user's perspective, things that seem simple to do are in fact simple to do.So, it would be great if you could indeed in a future update make:
g.V().outE().as('e').values('weight').max().path()return the "expected" path.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/e6dfd1a9-da7a-4ccb-8534-7e5185dc81dc%40googlegroups.com.