Skip to content
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

Mixed number list operations (like intersection) #972

Closed
jexp opened this issue Nov 6, 2018 · 1 comment
Closed

Mixed number list operations (like intersection) #972

jexp opened this issue Nov 6, 2018 · 1 comment
Labels
core-functionality Adding new procedure, function or signature to APOC core Larus

Comments

@jexp
Copy link
Member

jexp commented Nov 6, 2018

@conker84 something interesting about the "intersection" in general is that there might be lists of mixed numbers. like doubles and longs and then folks might expect cypher semantics of 1.0 == 1.

But we should cover that in a separate issue I think.

Where we could have an separate method or means, e.g. by converting a list of numbers into a list of doubles or longs and then doing the intersection.

There is also the option of having a more lenient comparator which uses the default comparator as long as both values are the same type and the double comparator when it's mixed types.

@vga91
Copy link
Collaborator

vga91 commented Feb 18, 2025

With the new versions of Cypher is no longer needed.
For example, executing the following 2 queries, the result is [2,3] for both of them

RETURN apoc.coll.intersection([1,2,3],[3,2]) AS value;  // with 2 and 2 values

RETURN apoc.coll.intersection([1,2,3],[3,2.0]) AS value; // with 2 and 2.0 values

@vga91 vga91 closed this as completed Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-functionality Adding new procedure, function or signature to APOC core Larus
Projects
None yet
Development

No branches or pull requests

3 participants