UNPKG

@neo4j/cypher-builder

Version:

A programmatic API for building Cypher queries for Neo4j

36 lines (35 loc) 1.39 kB
"use strict"; /* * Copyright (c) "Neo4j" * Neo4j Sweden AB [http://neo4j.com] */ Object.defineProperty(exports, "__esModule", { value: true }); exports.current = current; exports.earliest = earliest; exports.query = query; const CypherProcedure_1 = require("../../procedures/CypherProcedure"); const normalize_expr_1 = require("../../utils/normalize-expr"); const CDC_NAMESPACE = "db.cdc"; /** Acquire a change identifier for the last committed transaction * @see [Neo4j Documentation](https://neo4j.com/docs/cdc/current/procedures/current/) * @group Procedures */ function current() { return new CypherProcedure_1.CypherProcedure("current", [], CDC_NAMESPACE); } /** Acquire a change identifier for the earliest available change * @see [Neo4j Documentation](https://neo4j.com/docs/cdc/current/procedures/earliest/) * @group Procedures */ function earliest() { return new CypherProcedure_1.CypherProcedure("earliest", [], CDC_NAMESPACE); } /** Query the database for captured changes * @see [Neo4j Documentation](https://neo4j.com/docs/cdc/current/procedures/query/) * @group Procedures */ function query(from, selectors = []) { const fromExpr = (0, normalize_expr_1.normalizeExpr)(from); const selectorsExpr = (0, normalize_expr_1.normalizeList)(selectors); return new CypherProcedure_1.CypherProcedure("query", [fromExpr, selectorsExpr], CDC_NAMESPACE); }