`resets`

Generic Description

Counts downward movements in a counter-like sequence. It is documented separately because time construction, sequence ordering, window parameters, and as-of behavior materially change analytical meaning.

Simple example:

WITH [10.0, 13.0, 2.0, 5.0] AS counter_values
RETURN resets(counter_values) AS reset_count

Consumer-Level Explanation

Use it for counters that restart after service restarts, rollover, or source resets. Prefer this function when the temporal assumption should be visible to the planner, especially for event streams, freshness checks, and sequence features.

More Detailed Explanation

resets works on ordered temporal or sequence-style values inside Cypher. The practical contract is to assemble the sequence deliberately, choose the time or window parameter explicitly, and return named fields so downstream planner tooling does not invent unsupported window syntax.

Advanced Example

This example names the event stream and operational context before applying resets, which helps planner tooling preserve the intended sequence semantics.

WITH 'sensor-1' AS subject_id,
     [10.0, 13.0, 2.0, 5.0] AS counter_values
RETURN subject_id,
       resets(counter_values) AS reset_count

Real Use Cases

Real Limitations And Tradeoffs