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

Here myProperty is of integer type and I wish to save an empty value for 'myProperty'.

I know null is not supported. Is there another alternative to achieve the same? (I can't save the value as 0 either)

Sunitha
  • 241
  • 1
  • 5
  • 17

1 Answers1

0

As there is no notion of null in TinkerPop (for now) I'm afraid that you either have to remove the property or define some sort of constant to represent it. You say that you can't use "zero" but perhaps you could use something like Integer.MIN_VALUE or something? Or, if you are using a graph that doesn't have an explicit schema you could set it to a non-integer value like a "null" string? I can't reall think of any other workarounds.

stephen mallette
  • 45,298
  • 5
  • 67
  • 135