2

I have tried below query

g.V(12345678).property("names",["Akshay"] as List)

It worked fine in my case. But I want value datatype to be a Set. Hence I tried below query.

g.V(12345678).property("names",["Akshay"] as Set)

But exception like this

Property value [[Akshay]] is of type class java.util.LinkedHashSet is not supported Display stack trace? [yN] n

Please tell me a way to save value datatype as Set

Akshay Gaikwad
  • 420
  • 6
  • 13

1 Answers1

0

Values need to be added one by one. If you only need to add one value, it's pretty easy:

g.V(12345678).property(set,"names","Akshay")

If you have a set of values to add, you can do something like this:

g.V(12345678).as("v").
  constant(["Akshay","Daniel"]).unfold().as("n").
  select("v").
    property(set,"names",select("n"))
Daniel Kuppitz
  • 10,846
  • 1
  • 25
  • 34
  • 1
    compilation error unexpected token any other better approach as the values will be dynamic – mmr25 Dec 09 '20 at 06:35