Skip to content

Correct the contradictory empty-range direction condition in the range() documentation #14013

Open

Description

@choeoe

Neo4j version: Documentation issue in the Neo4j 5 and current manuals
Operating system: Not applicable
Installation method: Not applicable
API/Driver: Cypher documentation

Documentation page

https://neo4j.com/docs/cypher-manual/5/functions/list/#functions-range

The same wording also appears in the current manual:

https://neo4j.com/docs/cypher-manual/current/functions/list/#functions-range

Description

The range() considerations describe the sign condition for an empty range using start - end, but the example on the same line contradicts that expression.

The page says an empty range is returned when a negative step is paired with a positive start - end (or vice versa), then gives:

range(0, 5, -1)

For that example, start - end is 0 - 5 = -5, so both step and start - end are negative. The prose therefore does not describe its own example.

Expected documentation

Please express the rule in a direction-oriented form, for example that the range is empty when the step points away from the end value, or use a sign expression whose variables agree with the example.

Existing issue check

I searched open and closed neo4j/neo4j issues for the range() sign condition and this documentation wording. I did not find an exact documentation issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions