@neo4j/cypher-builder
Version:
A programmatic API for building Cypher queries for Neo4j
36 lines (35 loc) • 1.14 kB
TypeScript
import type { CypherEnvironment } from "../../Environment";
import type { Variable } from "../../references/Variable";
import type { CypherCompilable, Expr } from "../../types";
import { MapExpr } from "./MapExpr";
/** Represents a Map projection
* @see {@link https://neo4j.com/docs/cypher-manual/current/syntax/maps/#cypher-map-projection | Cypher Documentation}
* @group Maps
* @example
* ```cypher
* this { .title }
* ```
*/
export declare class MapProjection implements CypherCompilable {
private readonly extraValues;
private readonly variable;
private readonly projection;
private readonly isStar;
constructor(variable: Variable, projection?: "*" | string[], extraValues?: Record<string, Expr>);
set(values: Record<string, Expr> | string): void;
/** Converts the Map projection expression into a normal Map expression
* @example
* Converts
* ```cypher
* this { .title }
* ```
* into:
* ```cypher
* { title: this.title }
* ```
*/
toMap(): MapExpr;
/** @internal */
getCypher(env: CypherEnvironment): string;
private setExtraValues;
}