Repository navigation
feat: allow MATCH after OPTIONAL MATCH - #1942
Open
katarinasupe wants to merge 2 commits into
Open
katarinasupe wants to merge 2 commits into
katarinasupe wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Nov 20, 2026
Draft
katarinasupe
marked this pull request as ready for review
November 20, 2026 13:33
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Documents that a
MATCHcan follow anOPTIONAL MATCHwithout aWITHbetween them. Adds section 3, "Use MATCH after OPTIONAL MATCH", to the OPTIONAL MATCH clause page, with examples of which rows theMATCHdrops or keeps when anOPTIONAL MATCHvariable isnull, 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, memgraphc7321c420115, tests passed, includes the merge). Ran the new query onmemgraph/memgraph-mage:3.14.0to confirm the old error,MATCH can't be put after OPTIONAL MATCH., and that the same query withWITH *returns the same rows.Left out of the docs, covered by the release note below: nothing. A
MATCHafter an update clause still needs aWITH; that restriction didn't change, so it isn't on the page.Product PR
memgraph/memgraph#5407
Checklist
featureorbugfixlabel addedRelease 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
MATCHcan now followOPTIONAL MATCHwithout aWITHbetween them. Wherethe
OPTIONAL MATCHfinds nothing, aMATCHthat uses its variables returnsno 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 frontmatterdescriptionis 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 queriesLIVES_IN, which the dataset doesn't have (it usesLIVING_IN); the text below it sayscountry.namealthough the variable isc, and its output block showsUnited Kingdomunquoted where mgconsole prints"United Kingdom".pages/querying/clauses/optional-match.md: the dataset image alt text is "Data set"; the intro says "OPTIONAL MATCHclause behaves" (missing "The"); section 1 uses future tense ("will return") and mixesNULLandnull; "Dataset queries" says "We encourage you".