是否可以在 gremlin 中为整数类型保存一个空值

Is it possible to save an empty value for an integer type in gremlin

g.V(123).property('myProperty', myproperty? myProperty: null)

这里的myProperty是整数类型,我想为'myProperty'保存一个空值。

我知道不支持 null。有没有另一种选择来实现同样的目标? (我也无法将值保存为0)

由于 TinkerPop (for now) 中没有 null 的概念,恐怕您必须删除 属性 或定义某种常量来表示它.你说你不能使用 "zero" 但也许你可以使用 Integer.MIN_VALUE 之类的东西?或者,如果您使用的图表没有显式模式,您可以将其设置为非整数值,例如 "null" 字符串?我真的想不出任何其他解决方法。