import type { PathAssign } from "../pattern/PathAssign"; import type { Pattern } from "../pattern/Pattern"; import type { QuantifiedPath } from "../pattern/quantified-patterns/QuantifiedPath"; import { Clause } from "./Clause"; import { WithCall } from "./mixins/clauses/WithCall"; import { WithCallProcedure } from "./mixins/clauses/WithCallProcedure"; import { WithCreate } from "./mixins/clauses/WithCreate"; import { WithFinish } from "./mixins/clauses/WithFinish"; import { WithForeach } from "./mixins/clauses/WithForeach"; import { WithLet } from "./mixins/clauses/WithLet"; import { WithMerge } from "./mixins/clauses/WithMerge"; import { WithReturn } from "./mixins/clauses/WithReturn"; import { WithUnwind } from "./mixins/clauses/WithUnwind"; import { WithWith } from "./mixins/clauses/WithWith"; import { WithDelete } from "./mixins/sub-clauses/WithDelete"; import { WithOrder } from "./mixins/sub-clauses/WithOrder"; import { WithSetRemove } from "./mixins/sub-clauses/WithSetRemove"; import { WithWhere } from "./mixins/sub-clauses/WithWhere"; export interface Match extends WithReturn, WithWhere, WithSetRemove, WithWith, WithDelete, WithUnwind, WithCreate, WithMerge, WithFinish, WithCallProcedure, WithCall, WithOrder, WithForeach, WithLet { } /** Patterns supported by Match */ export type MatchClausePattern = Pattern | QuantifiedPath | PathAssign; /** * @see {@link https://neo4j.com/docs/cypher-manual/current/clauses/match/ | Cypher Documentation} * @group Clauses */ export declare class Match extends Clause { private readonly patterns; private _optional; private shortestStatement; private mode; constructor(...patterns: MatchClausePattern[]); /** Makes the clause an OPTIONAL MATCH * @see {@link https://neo4j.com/docs/cypher-manual/current/clauses/optional-match/ | Cypher Documentation} * @example * ```ts * new Cypher.Match(new Node({labels: ["Movie"]})).optional(); * ``` * _Cypher:_ * ```cypher * OPTIONAL MATCH (this:Movie) * ``` */ optional(): this; /** Add a {@link Match} clause * @see {@link https://neo4j.com/docs/cypher-manual/current/clauses/match/ | Cypher Documentation} */ match(clauseOrPattern: Match | MatchClausePattern): Match; /** Add an {@link OptionalMatch} clause * @see {@link https://neo4j.com/docs/cypher-manual/current/clauses/optional-match/ | Cypher Documentation} */ optionalMatch(clauseOrPattern: OptionalMatch | MatchClausePattern): OptionalMatch; /** * @since Neo4j 5.21 */ shortest(k: number): this; /** * @since Neo4j 5.21 */ shortestGroups(k: number): this; /** * @since Neo4j 5.21 */ allShortest(): this; /** * @since Neo4j 5.21 */ any(): this; /** Add `REPEATABLE ELEMENTS` mode to `MATCH` clause * @see {@link https://neo4j.com/docs/cypher-manual/25/patterns/match-modes/#repeatable-elements | Cypher Documentation} * @since Neo4j 2025.06 */ repeatableElements(): this; /** Add `DIFFERENT RELATIONSHIPS` mode to `MATCH` clause * @see {@link https://neo4j.com/docs/cypher-manual/25/patterns/match-modes/#different-relationships | Cypher Documentation} * @since Neo4j 2025.06 */ differentRelationships(): this; private getShortestStatement; private getModeStr; } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/clauses/optional-match/ | Cypher Documentation} * @group Clauses */ export declare class OptionalMatch extends Match { constructor(...patterns: MatchClausePattern[]); }