Skip to content

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

Open
@isstabb

Description

@isstabb

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions