我想在增加时highScore
根据用户更新 a 。score
如果新增加score
的大于highScore
,则设置highScore
= score
。
// initial data
g.addV("player")
.property(id, 1)
.property(single, "score", 0)
.property(single, "highScore", 0)
// increment score by 1 and set highScore if required
g.V(1)
.sack(assign)
.by("score")
.sack(sum)
.by(__.constant(1))
.property(single, "score", sack())
.choose(
__.values("highScore").is(lt(__.values("score"))),
__.property(single, "highScore", __.values("score")))
)
它似乎在lt(__.values("score"))
. 它将其解析为遍历而不是值。
com.amazon.neptune.tinkerpop.structure.NeptuneGraph$NeptuneGraphTraversal 不能转换为 java.lang.Integer
如何将当前值传递score
到该谓词中?我试过添加.value()
,.iterate()
和.next()