问题
It used to be that both those statements would work in Java:
GraphTraversalSource g =...;
String[] labels = new String[]{"label1","label2","label3"};
g.V().hasLabel(labels);
g.V().hasLabel("label1", "label2", "label3");
After upgrading to 3.2.5-SNAPSHOT only the later one is supported and I am getting "Cannot resolve method hasLabel(java.lang.String[])"
.
Apparently hasLabel(String label, String... otherLabels)
collides with hasLabel(P<String> predicate)
. Is there a work around for that so I can still build a list of labels incrementally?
Thanks!
回答1:
You could force it to use hasLabel(String label, String... otherLabels)
g.V().hasLabel(labels[0], labels);
来源:https://stackoverflow.com/questions/43213617/after-gremlin-3-2-5-snapshot-i-cant-pass-an-array-of-vertex-labels-in-function