---
title: recency
url: https://nexyron.tech/docs/cypher/functions/temporal/recency
description: Is a live Cypher function in Nexyron. It is documented separately because time construction, sequence ordering, window parameters, and as of behavior materially change analytical m
---

# recency

## Generic Description

Is a live Cypher function in Nexyron. It is documented separately because time construction, sequence ordering, window parameters, and as-of behavior materially change analytical meaning.

Simple example:

```cypher
RETURN recency(datetime('2026-03-01T12:00:00Z'))
```

## Consumer-Level Explanation

Use it when the function semantics match the query intent exactly. 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

`recency` should be understood by the value shape it expects and the row shape it returns. It composes with `MATCH`, `WHERE`, `WITH`, `RETURN`, and procedure output, so planner-facing documentation should describe both the immediate value transformation and why it belongs in the database query.

## Advanced Example

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

```cypher
MATCH (u:User)-[e:OPENED]->(d:Document)
WITH u,
     d,
     recency(e.ts) AS event_age_ms,
     properties(d.metadata) AS doc_meta
RETURN u.user_id,
       d.title,
       event_age_ms,
       size(keys(doc_meta)) AS metadata_fields
ORDER BY event_age_ms ASC
LIMIT 20
```

## Real Use Cases

-   keeping value shaping visible to the planner and reviewers
-   combining graph structure with document-style payload handling
-   returning named, typed fields that downstream tooling can reason about

## Real Limitations And Tradeoffs

-   the function does not repair incorrectly modeled input values
-   nearby aliases may be clearer if they express the business intent more directly
-   broad use inside hot filters should be reviewed for cost and index interaction
