Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@neo4j/cypher-builder
Advanced tools
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",
}
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.
1.19.0
#369 3514bdd
Thanks @angrykoala! - Add support for LOAD CSV:
const row = new Cypher.Variable();
const loadClause = new Cypher.LoadCSV("https://data.neo4j.com/bands/artists.csv", row).return(row);
#354 ef49a96
Thanks @angrykoala! - Add support for quantifier patterns:
const m = new Cypher.Node();
const m2 = new Cypher.Node();
const quantifiedPath = new Cypher.QuantifiedPath(
new Cypher.Pattern(m, { labels: ["Movie"], properties: { title: new Cypher.Param("V for Vendetta") } }),
new Cypher.Pattern({ labels: ["Movie"] })
.related({ type: "ACTED_IN" })
.to({ labels: ["Person"] })
.quantifier({ min: 1, max: 2 }),
new Cypher.Pattern(m2, {
labels: ["Movie"],
properties: { title: new Cypher.Param("Something's Gotta Give") },
})
);
const query = new Cypher.Match(quantifiedPath).return(m2);
Cypher
MATCH (this0:Movie { title: $param0 })
((:Movie)-[:ACTED_IN]->(:Person)){1,2}
(this1:Movie { title: $param1 })
RETURN this1
#371 6d1b0c4
Thanks @angrykoala! - Add LOAD CSV
related functions:
file()
linenumber()
FAQs
A programmatic API for building Cypher queries for Neo4j
The npm package @neo4j/cypher-builder receives a total of 18,556 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 0 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.