Gremlin vertex with list properties #212
Answered
by
lvca
michaelawarren
asked this question in
Q&A
-
I'm trying to create a property with a list of values. It looks like there is support for this DataTypes. This worked in Orient DB which ArcadeData says it is a fork of. Is there a way to make this work with gremlin queries. g.addV().property(list, 'myList', ['a', 'b']) |
Beta Was this translation helpful? Give feedback.
Answered by
lvca
Nov 18, 2021
Replies: 1 comment 2 replies
-
Unbale to reproduce it. Tested this and works: @Test
public void testGremlinLists() throws ExecutionException, InterruptedException {
final ArcadeGraph graph = ArcadeGraph.open("./target/testlist");
try {
final ResultSet result = graph.gremlin("g.addV('Person').property( 'list', ['a', 'b'] )").execute();
Assertions.assertTrue(result.hasNext());
final Result v = result.next();
Assertions.assertTrue(v.isVertex());
final List list = (List) v.getVertex().get().get("list");
Assertions.assertEquals(2, list.size());
Assertions.assertTrue(list.contains("a"));
Assertions.assertTrue(list.contains("b"));
} finally {
graph.drop();
}
} |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
michaelawarren
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unbale to reproduce it. Tested this and works: