-
Notifications
You must be signed in to change notification settings - Fork 500
fixes #699 - implement functions from pgsql #860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/main/java/apoc/coll/Coll.java
Outdated
@UserFunction | ||
@Description("apoc.coll.different(values) - returns true if values are different") | ||
public boolean different(@Name("values") List<Object> values) { | ||
for(int i=0; i<values.size()-1;i++){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
always use foreach
this one is just return new HashSet(values).size() == values.size()
src/main/java/apoc/label/Label.java
Outdated
@Description("apoc.label.exists(element, label) - returns true or false related to label existance") | ||
public boolean exists(@Name("node") Object element, @Name("label") String label) { | ||
|
||
return element instanceof Node?((Node) element).hasLabel(() -> label) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while the lambda approach is cool, I'm not sure if it's more efficient htan just using Label.label(label)
return degree; | ||
} | ||
|
||
@UserFunction("apoc.node.degree.in") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just use node.getDegree(type, direction)
please no manual counting.
src/main/java/apoc/nodes/Nodes.java
Outdated
} | ||
|
||
} | ||
private long getTotalNeighbors(Node node, String types, Direction direction) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this
Thanks a lot! |
No description provided.