UNPKG

@neo4j/cypher-builder

Version:

A programmatic API for building Cypher queries for Neo4j

28 lines (27 loc) 726 B
"use strict"; /* * Copyright (c) "Neo4j" * Neo4j Sweden AB [http://neo4j.com] */ Object.defineProperty(exports, "__esModule", { value: true }); exports.PathAssign = void 0; const CypherASTNode_1 = require("../CypherASTNode"); /** * @group Patterns */ class PathAssign extends CypherASTNode_1.CypherASTNode { variable; pattern; constructor(pattern, variable) { super(); this.addChildren(pattern); this.pattern = pattern; this.variable = variable; } getCypher(env) { const patternStr = this.pattern.getCypher(env); const variableStr = this.variable.getCypher(env); return `${variableStr} = ${patternStr}`; } } exports.PathAssign = PathAssign;