After Gremlin 3.2.5-SNAPSHOT I can't pass an array of vertex labels in function hasLabel()

狂风中的少年 提交于 2019-12-11 05:47:34

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!