-
Notifications
You must be signed in to change notification settings - Fork 495
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
Feature Request: expose isEqualCollection to cypher #151
Comments
Did you try in cypher |
Unless I'm mistaken, isEqualCollection() ignores ordering, it returns true if all elements in both collections are the same, and the cardinality (# of occurrences) of each element are the same. In Cypher, I wanted to check if |
So |
Oddly enough, containsAll() doesn't seem to be available with apoc-3.1.0.2-all, I get an error if attempting to call it:
However, I don't think this would work, at least where elements of the collection repeat. This would work for [1,2,3] and [3,2,1], but would not work for [1,1,2,3] and [1,2,2,3], containsAll() in either direction would return true, and the length would be the same, but the cardinalities of the elements would be different. The backing collection used for this couldn't be a set. We would need some kind of counted bag collection or similar. |
It's now a function, so you can call it in-line.
But then isCollectionEqual is rather a disjunct() on sets which also exists
as function.
…On Tue, Dec 13, 2016 at 1:32 AM, InverseFalcon ***@***.***> wrote:
Oddly enough, containsAll() doesn't seem to be available with
apoc-3.1.0.2-all, I get an error if attempting to call it:
There is no procedure with the name apoc.coll.containsAll registered for
this database instance. Please ensure you've spelled the procedure name
correctly and that the procedure is properly deployed.
However, I don't think this would work, at least where elements of the
collection repeat. This would work for [1,2,3] and [3,2,1], but would not
work for [1,1,2,3] and [1,2,2,3], containsAll() in either direction would
return true, and the length would be the same, but the cardinalities of the
elements would be different.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#151 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAEHY-C0759wZ9g60JMLGe-fCzWpVXk2ks5rHeergaJpZM4KB0hN>
.
|
…in any order - cleanup formatting
…in any order - simplify using groupingBy collector
…in any order - null checks
…in any order - == check removal
…in any order - new null check tests
See: CollectionUtils#isEqualCollection
This would be very useful to check if two collections are the same. As far as I'm aware this isn't exposed to cypher.
The text was updated successfully, but these errors were encountered: