Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@neo4j/cypher-builder
Advanced tools
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.
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",
}
You can find usage examples in the examples folder and in CodePen.
yarn test
to run cypher builder testsyarn build
to compile cypher builder libraryyarn docs
to generate the API reference docs0.4.0
#3147 2bc2c7019
Thanks @angrykoala! - Refactor Cypher.Map to use a Map internally, include .size method and remove support for undefined fields
#3106 bfae63097
Thanks @darrellwarde! - The type Cypher.PropertyRef
is now fully exported under Cypher.Property
for use with utilities such as instanceof
. However, it maintains the current behaviour of not being directly instantiable.
#3115 a04ef4469
Thanks @angrykoala! - Map projections inject the leading dot (.) in the map fields automatically.
#3091 0d7a140ae
Thanks @angrykoala! - Add support for using sets when defining the labels of a Node
#3153 d47624ea1
Thanks @MacondoExpress! - Adds divide
, multiply
, mod
, pow
to the Math Operators.
#3154 b276bbae2
Thanks @angrykoala! - Add inequality operator (<>) with Cypher.neq
FAQs
A programmatic API for building Cypher queries for Neo4j
The npm package @neo4j/cypher-builder receives a total of 12,640 weekly downloads. As such, @neo4j/cypher-builder popularity was classified as popular.
We found that @neo4j/cypher-builder demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.