Skip to content

feat: allow MATCH after OPTIONAL MATCH - #1942

Open
katarinasupe wants to merge 2 commits into
release/3.15from
docs/match-after-optional-match
Open

katarinasupe wants to merge 2 commits into
release/3.15from
docs/match-after-optional-match

Conversation

@katarinasupe

@katarinasupe katarinasupe commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

Documents that a MATCH can follow an OPTIONAL MATCH without a WITH between them. Adds section 3, "Use MATCH after OPTIONAL MATCH", to the OPTIONAL MATCH clause page, with examples of which rows the MATCH drops or keeps when an OPTIONAL MATCH variable is null, and the error raised before Memgraph 3.15.

Ran all of the page's examples in order on the 20261119 daily MAGE build (memgraph/memgraph-mage:3.14.0_pr5334_c7321c420115, memgraph c7321c420115, tests passed, includes the merge). Ran the new query on memgraph/memgraph-mage:3.14.0 to confirm the old error, MATCH can't be put after OPTIONAL MATCH., and that the same query with WITH * returns the same rows.

Left out of the docs, covered by the release note below: nothing. A MATCH after an update clause still needs a WITH; that restriction didn't change, so it isn't on the page.

Product PR

memgraph/memgraph#5407

Checklist

  • For a product change: milestone set to the release and feature or bugfix label added
  • For a product change: this PR is linked from the product PR's documentation checklist

Release note

Copied into the release notes when the release is prepared. Fix an item if it's wrong; keep the heading and the item format.

New features

  • MATCH can now follow OPTIONAL MATCH without a WITH between them. Where
    the OPTIONAL MATCH finds nothing, a MATCH that uses its variables returns
    no row.
    OPTIONAL MATCH clause
    #5407

Noticed, not fixed

Read by the release check, which fixes these in one PR per release. Fix an item if it's wrong; keep the heading and one line per item, starting with the page.

  • pages/querying/clauses/optional-match.md: the frontmatter description is two filler sentences ("Understand the use of OPTIONAL MATCH in Memgraph. Detailed docs…") instead of one sentence saying what the reader can do.
  • pages/querying/clauses/optional-match.md: section 2 queries LIVES_IN, which the dataset doesn't have (it uses LIVING_IN); the text below it says country.name although the variable is c, and its output block shows United Kingdom unquoted where mgconsole prints "United Kingdom".
  • pages/querying/clauses/optional-match.md: the dataset image alt text is "Data set"; the intro says "OPTIONAL MATCH clause behaves" (missing "The"); section 1 uses future tense ("will return") and mixes NULL and null; "Dataset queries" says "We encourage you".

@katarinasupe katarinasupe added this to the 3.15 milestone Nov 20, 2026
@katarinasupe katarinasupe added the feature Documentation related to a new product feature of feature update label Nov 20, 2026
@katarinasupe katarinasupe self-assigned this Nov 20, 2026
@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
documentation Ready Ready Preview Nov 20, 2026 1:36pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — 2802c721 Deployed Nov 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Documentation related to a new product feature of feature update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant