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

Add ability to specify null ordering (i.e. nullsFirst and nullsLast) in sorts #308

Open
isstabb opened this issue Nov 30, 2023 · 0 comments

Comments

@isstabb
Copy link
Contributor

isstabb commented Nov 30, 2023

Being able to specify null ordering is a common approach (see nullsFirst and nullsLast in https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html). By default cypher puts nulls last on ascending and first on descending. But that is not always desirable, e.g. when sorting priorities descending, perhaps null priorities should not be above highest priorities.

Attempted workarounds include:

  • adding a @cypher directive to COALESCE nulls into something that works. However, you cannot sort on a @cypher directive field
  • adding another field with @cypher directive to derive a sort field, but again it cannot be sorted on

A working workaround is to change the data in some way to facilitate the sort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant