Skip to content

Gremlin vertex with list properties #212

Answered by lvca
michaelawarren asked this question in Q&A
Discussion options

You must be logged in to vote

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();
…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@michaelawarren
Comment options

@lvca
Comment options

lvca Nov 18, 2021
Maintainer

Answer selected by michaelawarren
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
invalid This doesn't seem right
2 participants