--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/2dc61705-6e66-40f2-b70f-5c53c0fa20deo%40googlegroups.com.
Your String[] is being interpreted as varargs which become meta-properties:gremlin> g.addV().property(VertexProperty.Cardinality.list, "test", ["value1", "value2"] as String[])
The provided key/value array length must be a multiple of two
Type ':help' or ':h' for help.
Display stack trace? [yN]n
gremlin> g.addV().property(VertexProperty.Cardinality.list, "test", ["value1", "value2","value3"] as String[])
==>v[0]
gremlin> g.V().properties('test')
==>vp[test->value1]
gremlin> g.V().properties('test').properties()
==>p[value2->value3]I suppose the question is, are you trying to do multi-properties of two strings "value1" and "value2" or are you doing multi-properties of String[]. If the former then:gremlin> g.addV().property(VertexProperty.Cardinality.list, "test", "value1").property(VertexProperty.Cardinality.list, "test", "value2")
==>v[0]
gremlin> g.V().properties('test')
==>vp[test->value1]
==>vp[test->value2]If the latter then I would probably try to store it as a List<String> rather than String[].
On Fri, Jun 26, 2020 at 9:08 AM Thomas Driessen <thomas.d...@gmail.com> wrote:
Hi,--I'm not sure if this is a bug or if I'm using this method incorrectly, so here's what I've done:When I callg.V(someid).property(Cardinality.list, "test", new String[]{"value1", "value2"})I receive an java.lang.IllegalArgumentException: The provided key/value array length must be a multiple of twoHowever if I'm doing the same without explicitly stating the Cardinality like this:g.V(someId).property("test", new String[]{"value1", "value2"})the property is added as expected and I also get the array back when I query it.Is this a bug or am I doing something wrong?Gremlin version I'm using: 3.4.4Kind regards,Thomas
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremli...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/5b8c6a32-4d0d-4680-b0cc-d884a6fe05c3n%40googlegroups.com.