@neo4j/cypher-builder
TypeScript icon, indicating that this package has built-in type declarations

1.17.0 • Public • Published

Cypher Builder

npm version Test Lint

Cypher Builder is a JavaScript programmatic API to create Cypher queries for Neo4j.

import Cypher from "@neo4j/cypher-builder";

const movieNode = new Cypher.Node();
const pattern = new Cypher.Pattern(movieNode, { labels: ["Movie"] });

const matchQuery = new Cypher.Match(pattern)
    .where(movieNode, {
        title: new Cypher.Param("The Matrix"),
    })
    .return(movieNode.property("title"));

const { cypher, params } = matchQuery.build();

console.log(cypher);
console.log(params);

Cypher

MATCH (this0:Movie)
WHERE this0.title = $param0
RETURN this0.title

Params

{
    "param0": "The Matrix",
}

Examples

You can find usage examples in the examples folder.

This library is for JavaScript and TypeScript only. If you are using Java, check Neo4j Cypher DSL.

/@neo4j/cypher-builder/

    Package Sidebar

    Install

    npm i @neo4j/cypher-builder

    Weekly Downloads

    15,303

    Version

    1.17.0

    License

    Apache-2.0

    Unpacked Size

    441 kB

    Total Files

    235

    Last publish

    Collaborators

    • oskardamkjaer
    • neo4j-organization
    • oskarhane
    • linuslundahl
    • adamcowley
    • darrellwarde