@neo4j/cypher-builder
Advanced tools
Changelog
1.22.2
#437 fa520b8
Thanks @angrykoala! - Add support for patterns in size()
for Neo4j 4
const pattern = new Cypher.Pattern(new Cypher.Node()).related().to();
const cypherFunction = Cypher.size(pattern);
size((this0)-[this1]->(this2))
Changelog
1.22.1
#430 f662ddd
Thanks @angrykoala! - Deprecate using a Node
as a constructor of Cypher.PatternComprehension
:
const node = new Cypher.Node();
const comprehension = new Cypher.PatternComprehension(node);
Changelog
1.22.0
#421 b9b75cd
Thanks @angrykoala! - Add support for OPTIONAL CALL
:
new Cypher.OptionalCall(subquery);
Alternatively
new Cypher.Call(subquery).optional();
To generate the following Cypher:
OPTIONAL CALL {
// Subquery
}
#420 77d8795
Thanks @angrykoala! - Add support for OFFSET
as an alias for SKIP
:
const matchQuery = new Cypher.Return(movieNode).orderBy([movieNode.property("age")]).offset(new Cypher.Param(10));
RETURN this0
ORDER BY this0.age ASC
OFFSET $param0
#425 e899ceb
Thanks @angrykoala! - Add support for order by, skip and limit chaining after the following clauses:
Changelog
1.21.0
#413 0f2dfe6
Thanks @angrykoala! - Add support for SHORTEST keyword in match and its variations:
.shortest(k)
.shortestGroups(k)
.allShortest
.any
For example:
new Cypher.Match(pattern).shortest(2).return(node);
MATCH ALL SHORTEST (this0:Movie)-[this1]->(this2:Person)
RETURN this0
#419 c7dd297
Thanks @angrykoala! - Add support for labels in set and remove:
const movie = new Cypher.Node();
const clause = new Cypher.Match(new Cypher.Pattern(movie)).set(movie.label("NewLabel"));
MATCH (this0)
SET
this0:NewLabel
Changelog
1.20.1
721fb85
Thanks @angrykoala! - Deprecates Cypher.concat
in favor of Cypher.utils.concat
Changelog
1.20.0
#399 02c7e99
Thanks @angrykoala! - Add support for variable scope in CALL:
const movieNode = new Cypher.Node();
const actorNode = new Cypher.Node();
const clause = new Cypher.Call(new Cypher.Create(new Cypher.Pattern(movieNode).related().to(actorNode)), [
movieNode,
actorNode,
]);
CALL (this0, this1) {
CREATE (this0)-[this2]->(this1)
}
#403 eed7686
Thanks @angrykoala! - Add support for adding Call
clauses to Match
and With
:
const match = new Cypher.Match(new Cypher.Pattern(movieNode, { labels: ["Movie"] }))
.call(new Cypher.Create(new Cypher.Pattern(movieNode).related().to(actorNode)), [movieNode])
.return(movieNode);
MATCH (this0:Movie)
CALL (this0) {
CREATE (this0)-[this2]->(this1)
}
RETURN this0
#396 f39056f
Thanks @angrykoala! - Add support for GQL type aliases introduced in Neo4j 5.23:
Cypher.TYPE.TIMESTAMP_WITHOUT_TIME_ZONE
Cypher.TYPE.TIME_WITHOUT_TIME_ZONE
Cypher.TYPE.TIMESTAMP_WITH_TIME_ZONE
Cypher.TYPE.TIME_WITH_TIME_ZONE
Changelog
1.19.1
#373 99eb375
Thanks @angrykoala! - Add support for new Union().distinct()
#378 51ae499
Thanks @angrykoala! - Add support for trimCharacter on rtrim and ltrim
#377 d4c790e
Thanks @angrykoala! - Add support for btrim
#378 51ae499
Thanks @angrykoala! - Deprecates lTrim
and rTrim
in favour of ltrim
and rtrim
Changelog
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()
Changelog
1.18.1
#366 5fa3f51
Thanks @angrykoala! - Add support for multiple expressions on the simple CASE:
matchClause.return(
new Cypher.Case(person.property("eyes"))
.when(new Cypher.Literal("brown"), new Cypher.Literal("hazel"))
.then(new Cypher.Literal(2))
Changelog
1.18.0
#365 6f20b0a
Thanks @angrykoala! - Add support for CALL { … } IN CONCURRENT TRANSACTIONS
:
new Cypher.Call(subquery).inTransactions({
concurrentTransactions: 3,
});
CALL {
// Subquery
} IN 3 CONCURRENT TRANSACTIONS
#357 22f87f3
Thanks @angrykoala! - Support for procedures in the tx namespace:
tx.getMetaData
tx.setMetaData
#363 47ee1ef
Thanks @angrykoala! - Add functions lower
and upper
#361 e769f61
Thanks @angrykoala! - Add support for missing fulltext procedures:
db.index.fulltext.awaitEventuallyConsistentIndexRefresh
db.index.fulltext.listAvailableAnalyzers
#361 e769f61
Thanks @angrykoala! - Add support for missing db procedures:
db.ping
db.propertyKeys
db.relationshipTypes
db.resampleIndex
db.resampleOutdatedIndexes