@neo4j/cypher-builder
Version:
A programmatic API for building Cypher queries for Neo4j
30 lines (29 loc) • 871 B
JavaScript
;
/*
* Copyright (c) "Neo4j"
* Neo4j Sweden AB [http://neo4j.com]
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.Where = void 0;
const CypherASTNode_1 = require("../../CypherASTNode");
const boolean_1 = require("../../expressions/operations/boolean");
class Where extends CypherASTNode_1.CypherASTNode {
wherePredicate;
constructor(parent, whereInput) {
super(parent);
this.wherePredicate = whereInput;
this.addChildren(this.wherePredicate);
}
and(op) {
this.wherePredicate = (0, boolean_1.and)(this.wherePredicate, op);
this.addChildren(this.wherePredicate);
}
/** @internal */
getCypher(env) {
const opStr = this.wherePredicate.getCypher(env);
if (!opStr)
return "";
return `WHERE ${opStr}`;
}
}
exports.Where = Where;