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({
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);
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.11.0
#277 f97c229
Thanks @angrykoala! - Add support for type predicate expressions with the functions Cypher.isType
and Cypher.isNotType
:
const variable = new Cypher.Variable();
const unwindClause = new Cypher.Unwind([new Cypher.Literal([42, true, "abc", null]), variable]).return(
variable,
Cypher.isType(variable, Cypher.TYPE.INTEGER)
);
UNWIND [42, true, \\"abc\\", NULL] AS var0
RETURN var0, var0 IS :: INTEGER
#283 566e1d4
Thanks @angrykoala! - Prepends WITH on each UNION subquery when .importWith
is set in parent CALL:
const returnVar = new Cypher.Variable();
const n1 = new Cypher.Node({ labels: ["Movie"] });
const query1 = new Cypher.Match(n1).return([n1, returnVar]);
const n2 = new Cypher.Node({ labels: ["Movie"] });
const query2 = new Cypher.Match(n2).return([n2, returnVar]);
const unionQuery = new Cypher.Union(query1, query2);
const callQuery = new Cypher.Call(unionQuery).importWith(new Cypher.Variable());
The statement WITH var0
will be added to each UNION subquery
CALL {
WITH var0
MATCH (this1:Movie)
RETURN this1 AS var2
UNION
WITH var0
MATCH (this3:Movie)
RETURN this3 AS var2
}
#283 566e1d4
Thanks @angrykoala! - Deprecate Call.innerWith
in favor of Call.importWith
#289 b9a2ad6
Thanks @angrykoala! - Deprecates the second parameter of patternComprehensions in favor of new .map
method:
old
new Cypher.PatternComprehension(pattern, expr);
new
new Cypher.PatternComprehension(pattern).map(expr);
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.