Closed To-om closed 5 years ago
Hi @To-om
i think it's not a problem of ODB. It happens also with the in memory graph implementation TinkerGraph
@Test
public void shouldNotReturnDuplicatesWithVStep() {
TinkerGraph graph = TinkerFactory.createModern();
graph.clear();
final String labelVertex = "VertexLabel";
Vertex v1 = graph.addVertex(labelVertex);
graph.addVertex(labelVertex);
// graph.tx().commit();
Assert.assertEquals(1, graph.traversal().V(v1).toList().size()); // succeeds
Assert.assertEquals(1, graph.traversal().V().V(v1).toList().size()); // fails. toList returns [v1, v1]
graph.close();
}
Hi, I confirm this is not a bug. I misunderstand the purpose of this step. It is not a filter but a map. For each result, it retrieves the specified vertex. Thanks.
The
V
step in aGraphTraversal
returns duplicate vertices. (works as expected in aGraphTraversalSource
) The number of elements seems to depends on the total number of vertices that match the previous step. The following unit test fails: