对于Gremlin语法中Math函数的用法,请问是否能够对某列属性值进行操作,例如对age+;如果能那Gremlin语句如何写?
例如 name age
小明 21
小红 20
现在用math函数 对age 整列 +10
该如何写 Gremlin语句 谢谢!
@AmbitiousHERO 可以的:g.V().hasLabel('人').values('年龄').math('_ + 10')
在studio进行查询的时候报这个错误java.lang.String cannot be cast to java.lang.Number 说明在math括号里面有问题,您这个方式是不是在+号两侧有空格。 这种math(‘10+10’)就没问题 那可能就是我这边源码中有问题
@AmbitiousHERO 请确保你的age属性定义为数字类型了(如int、long、float、double等)。
我age属性之前是定义为asInt()它计算不了,我改为了asLong就能计算了,不知道为啥
Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label