Этот подход с использованием where()
, кажется, работает:
gremlin> g.V(1).as('a').
......1> sack(assign).
......2> by("score").
......3> sack(sum).
......4> by(__.constant(1)).
......5> property(single, "score", sack()).
......6> choose(where('a', lt('a')).by('highScore').by('score'),
......7> __.property(single, "highScore", sack()))
==>v[1]
gremlin> g.V().valueMap()
==>[score:[1],highScore:[1]]
gremlin> g.V(1).as('a').
......1> sack(assign).
......2> by("score").
......3> sack(sum).
......4> by(__.constant(1)).
......5> property(single, "score", sack()).
......6> choose(where('a', lt('a')).by('highScore').by('score'),
......7> __.property(single, "highScore", sack()))
==>v[1]
gremlin> g.V().valueMap()
==>[score:[2],highScore:[2]]
gremlin> g.V().property('highScore',10)
==>v[1]
gremlin> g.V().valueMap()
==>[score:[2],highScore:[10]]
gremlin> g.V(1).as('a').
......1> sack(assign).
......2> by("score").
......3> sack(sum).
......4> by(__.constant(1)).
......5> property(single, "score", sack()).
......6> choose(where('a', lt('a')).by('highScore').by('score'),
......7> __.property(single, "highScore", sack()))
==>v[1]
gremlin> g.V().valueMap()
==>[score:[3],highScore:[10]]