UNPKG

@neo4j/cypher-builder

Version:

A programmatic API for building Cypher queries for Neo4j

210 lines (209 loc) 6.98 kB
"use strict"; /* * Copyright (c) "Neo4j" * Neo4j Sweden AB [http://neo4j.com] */ Object.defineProperty(exports, "__esModule", { value: true }); exports.coalesce = coalesce; exports.elementId = elementId; exports.endNode = endNode; exports.head = head; exports.last = last; exports.length = length; exports.properties = properties; exports.randomUUID = randomUUID; exports.size = size; exports.startNode = startNode; exports.timestamp = timestamp; exports.toBoolean = toBoolean; exports.toBooleanOrNull = toBooleanOrNull; exports.toFloat = toFloat; exports.toFloatOrNull = toFloatOrNull; exports.toInteger = toInteger; exports.toIntegerOrNull = toIntegerOrNull; exports.type = type; exports.valueType = valueType; exports.char_length = char_length; exports.character_length = character_length; exports.nullIf = nullIf; const CypherFunctions_1 = require("./CypherFunctions"); /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-coalesce | Cypher Documentation} * @group Functions * @category Scalar */ function coalesce(expr, ...optionalExpr) { return new CypherFunctions_1.CypherFunction("coalesce", [expr, ...optionalExpr]); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-elementid | Cypher Documentation} * @group Functions * @category Scalar */ function elementId(variable) { return new CypherFunctions_1.CypherFunction("elementId", [variable]); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-endnode | Cypher Documentation} * @group Functions * @category Scalar */ function endNode(relationship) { return new CypherFunctions_1.CypherFunction("endNode", [relationship]); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-head | Cypher Documentation} * @group Functions * @category Scalar */ function head(expr) { return new CypherFunctions_1.CypherFunction("head", [expr]); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-last | Cypher Documentation} * @group Functions * @category Scalar */ function last(expr) { return new CypherFunctions_1.CypherFunction("last", [expr]); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-length | Cypher Documentation} * @group Functions * @category Scalar */ function length(path) { return new CypherFunctions_1.CypherFunction("length", [path]); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-properties | Cypher Documentation} * @group Functions * @category Scalar */ function properties(expr) { return new CypherFunctions_1.CypherFunction("properties", [expr]); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-randomuuid | Cypher Documentation} * @group Functions * @category Scalar */ function randomUUID() { return new CypherFunctions_1.CypherFunction("randomUUID"); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-size | Cypher Documentation} * @group Functions * @category Scalar */ function size(expr) { return new CypherFunctions_1.CypherFunction("size", [expr]); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-startnode | Cypher Documentation} * @group Functions * @category Scalar */ function startNode(relationship) { return new CypherFunctions_1.CypherFunction("startNode", [relationship]); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-timestamp | Cypher Documentation} * @group Functions * @category Scalar */ function timestamp() { return new CypherFunctions_1.CypherFunction("timestamp"); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-toboolean | Cypher Documentation} * @group Functions * @category Scalar */ function toBoolean(expr) { return new CypherFunctions_1.CypherFunction("toBoolean", [expr]); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-tobooleanornull | Cypher Documentation} * @group Functions * @category Scalar */ function toBooleanOrNull(expr) { return new CypherFunctions_1.CypherFunction("toBooleanOrNull", [expr]); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-tofloat | Cypher Documentation} * @group Functions * @category Scalar */ function toFloat(expr) { return new CypherFunctions_1.CypherFunction("toFloat", [expr]); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-tofloatornull | Cypher Documentation} * @group Functions * @category Scalar */ function toFloatOrNull(expr) { return new CypherFunctions_1.CypherFunction("toFloatOrNull", [expr]); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-tointeger | Cypher Documentation} * @group Functions * @category Scalar */ function toInteger(expr) { return new CypherFunctions_1.CypherFunction("toInteger", [expr]); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-tointegerornull | Cypher Documentation} * @group Functions * @category Scalar */ function toIntegerOrNull(expr) { return new CypherFunctions_1.CypherFunction("toIntegerOrNull", [expr]); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-type | Cypher Documentation} * @group Functions * @category Scalar */ function type(relationship) { return new CypherFunctions_1.CypherFunction("type", [relationship]); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-valueType | Cypher Documentation} * @group Functions * @category Scalar * @since Neo4j 5.13 */ function valueType(expr) { return new CypherFunctions_1.CypherFunction("valueType", [expr]); } /** Alias of size() * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-char_length | Cypher Documentation} * @group Functions * @category Scalar * @since Neo4j 5.13 */ function char_length(expr) { return new CypherFunctions_1.CypherFunction("char_length", [expr]); } /** Alias of size() * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-character_length | Cypher Documentation} * @group Functions * @category Scalar * @since Neo4j 5.13 */ function character_length(expr) { return new CypherFunctions_1.CypherFunction("character_length", [expr]); } /** * @see {@link https://neo4j.com/docs/cypher-manual/current/functions/scalar/#functions-nullIf | Cypher Documentation} * @group Functions * @category Scalar * @since Neo4j 5.14 */ function nullIf(expr1, expr2) { return new CypherFunctions_1.CypherFunction("nullIf", [expr1, expr2]); }