Skip to content

Clarify exists() function: property existence only, not graph patterns#397

Open
Copilot wants to merge 2 commits intomainfrom
copilot/update-exists-pattern-documentation
Open

Clarify exists() function: property existence only, not graph patterns#397
Copilot wants to merge 2 commits intomainfrom
copilot/update-exists-pattern-documentation

Conversation

Copy link
Contributor

Copilot AI commented Mar 21, 2026

exists(pattern) docs implied arbitrary graph patterns are supported. In practice, only property existence checks work — e.g. exists(n.prop). Passing relationship patterns like exists((n)-[]-()) errors out.

  • Changed signature from exists(_pattern_) to exists(_entity.property_) to reflect actual behavior
  • Updated description to "Returns true when the specified property exists on a given node or relationship"
  • Added note that graph patterns are unsupported, linking to FalkorDB#1315 and pointing users to pattern predicates in WHERE as the alternative
Original prompt

This section details on the original issue you should resolve

<issue_title>Clarify exists(pattern) function limitations</issue_title>
<issue_description>## Context

Migrated from FalkorDB/FalkorDB#1315.

Issue

The functions documentation describes the exists() predicate function as:

exists(pattern) — Returns true when at least one match for pattern exists

This implies that any graph pattern is supported. However, in practice, attempting to use exists() with a relationship pattern returns an error:

GRAPH.QUERY g "MATCH (n) WHERE exists((n)-[]-()) RETURN *"
(error) Unable to resolve filtered alias '(n)-[]-()'

Verified on FalkorDB v4.16.7 — the error still occurs.

Suggested Fix

Either:

  1. Update the docs to clarify what pattern types exists() actually supports (e.g., only property existence checks like exists(n.prop), or only specific pattern forms), or
  2. Note this as a known limitation and link to the related bug in the FalkorDB repo.

The WHERE clause docs show that pattern predicates work in WHERE directly (e.g., WHERE (p)-[:WON]->(s)), so users may be confused about why the same pattern doesn't work inside exists().</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…raph patterns

Co-authored-by: gkorland <753206+gkorland@users.noreply.github.com>
Agent-Logs-Url: https://github.com/FalkorDB/docs/sessions/ed50614f-198b-49bd-80b3-5173ee41bbaf
Copilot AI changed the title [WIP] Update documentation to clarify exists(pattern) function limitations Clarify exists() function: property existence only, not graph patterns Mar 21, 2026
Copilot AI requested a review from gkorland March 21, 2026 21:59
@gkorland gkorland requested review from Copilot and swilly22 March 21, 2026 22:48
@gkorland gkorland marked this pull request as ready for review March 21, 2026 22:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Cypher functions reference to accurately document FalkorDB’s exists() predicate as a property-existence check (not an arbitrary graph pattern existence predicate), and guides users to the correct alternative for graph-pattern filtering.

Changes:

  • Adjusted the documented signature from exists(_pattern_) to exists(_entity.property_).
  • Updated the description to clarify it checks for property existence on nodes/relationships.
  • Added a note that graph patterns are unsupported in exists(), linking to FalkorDB#1315 and pointing to WHERE pattern predicates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Successfully merging this pull request may close these issues.

Clarify exists(pattern) function limitations

3 participants