Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@neo4j/cypher-builder

Package Overview
Dependencies
Maintainers
7
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neo4j/cypher-builder

Neo4j Cypher query builder

  • 0.1.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19K
increased by15.14%
Maintainers
7
Weekly downloads
 
Created
Source

Cypher Builder - Beta

The Cypher builder is a library for building Cypher for Neo4j queries with a programmatic API.

Note that this library is still under development.

Try it live on CodePen.

Getting Started

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

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

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

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

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

In this example, cypher will be a string containing the following:

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

params will contain the parameters used in that query as an object:

{
    "param0": "The Matrix",
}

Examples

You can find usage examples in the examples folder and in CodePen.

Development

  • yarn test to run cypher builder tests
  • yarn build to compile cypher builder library
  • yarn docs to generate the API reference docs

Keywords

FAQs

Package last updated on 14 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc