@neo4j/cypher-builder
Version:
A programmatic API for building Cypher queries for Neo4j
58 lines (57 loc) • 2.37 kB
TypeScript
import { CypherASTNode } from "../../CypherASTNode";
import type { CypherEnvironment } from "../../Environment";
import type { Expr } from "../../types";
type MathOperator = "+" | "-" | "*" | "/" | "%" | "^";
/**
* @group Operators
* @category Math
*/
export declare class MathOp extends CypherASTNode {
private readonly operator;
private readonly exprs;
/** @internal */
constructor(operator: MathOperator, exprs: Expr[]);
/**
* @internal
*/
getCypher(env: CypherEnvironment): string;
}
/** Plus (+) operator. This operator may be used for addition operations between numbers or for string concatenation.
* @see {@link https://neo4j.com/docs/cypher-manual/current/syntax/operators/#query-operators-mathematical | Cypher Documentation}
* @see {@link https://neo4j.com/docs/cypher-manual/current/syntax/operators/#syntax-concatenating-two-strings | String Concatenation}
* @group Operators
* @category Math
*/
export declare function plus(leftExpr: Expr, rightExpr: Expr): MathOp;
export declare function plus(...exprs: Expr[]): MathOp;
/**
* @see {@link https://neo4j.com/docs/cypher-manual/current/syntax/operators/#query-operators-mathematical | Cypher Documentation}
* @group Operators
* @category Math
*/
export declare function minus(leftExpr: Expr, rightExpr: Expr): MathOp;
/**
* @see {@link https://neo4j.com/docs/cypher-manual/current/syntax/operators/#query-operators-mathematical | Cypher Documentation}
* @group Operators
* @category Math
*/
export declare function multiply(leftExpr: Expr, rightExpr: Expr): MathOp;
/**
* @see {@link https://neo4j.com/docs/cypher-manual/current/syntax/operators/#query-operators-mathematical | Cypher Documentation}
* @group Operators
* @category Math
*/
export declare function divide(leftExpr: Expr, rightExpr: Expr): MathOp;
/** Modulus (%) operator
* @see {@link https://neo4j.com/docs/cypher-manual/current/syntax/operators/#query-operators-mathematical | Cypher Documentation}
* @group Operators
* @category Math
*/
export declare function mod(leftExpr: Expr, rightExpr: Expr): MathOp;
/** Power (^) operator
* @see {@link https://neo4j.com/docs/cypher-manual/current/syntax/operators/#query-operators-mathematical | Cypher Documentation}
* @group Operators
* @category Math
*/
export declare function pow(leftExpr: Expr, rightExpr: Expr): MathOp;
export {};