@neo4j/cypher-builder
Advanced tools
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
Changelog
1.17.2
#355 acddbc3
Thanks @angrykoala! - Add the following procedures:
db.nameFromElementId
db.info
db.createLabel
db.createProperty
db.createRelationshipType
db.schema.nodeTypeProperties
db.schema.relTypeProperties
db.schema.visualization
#351 ef73177
Thanks @angrykoala! - Exports type ROUND_PRECISION_MODE
Changelog
1.17.0
#340 b1b7acf
Thanks @angrykoala! - Add vector similarity functions:
Cypher.vector.similarity.euclidean(param1, param2);
Cypher.vector.similarity.cosine(param1, param2);
#342 5bba4b5
Thanks @angrykoala! - Add support for FINISH clauses:
new Cypher.Finish()
new Cypher.Match(...).finish()
new Cypher.Create(...).finish()
new Cypher.Merge(...).finish()
Changelog
1.16.0
#333 2593296
Thanks @mjfwebb! - Adds support for genai function genai.vector.encode()
and procedure genai.vector.encodeBatch()
#328 628ec62
Thanks @mjfwebb! - Adds support for vector index functions db.index.vector.queryNodes()
and db.index.vector.queryRelationships()
#310 13fd317
Thanks @angrykoala! - Add support for arbitrary variables in Patterns instead of only Node and Relationship:
#310 13fd317
Thanks @angrykoala! - The following methods in Pattern
class and chains are deprecated:
withoutLabels
withoutVariable
withProperties
getVariables
withoutType
withDirection
withLength
Instead, these properties should be passed as an object, for example:
const a = new Cypher.Variable();
const rel = new Cypher.Variable();
const b = new Cypher.Variable();
const pattern = new Cypher.Pattern(a, { labels: ["Movie"] }).related(rel, { type: "ACTED_IN" }).to(b);
#310 98a8b2f
Thanks @angrykoala! - Deprecate using Node directly on Match, Create and Merge clauses. Use a Pattern instead
#310 7574aee
Thanks @angrykoala! - Deprecate setting up labels and types in Node and Relationship. The following examples are now deprecated:
new Cypher.Node({ labels: ["Movie"] });
new Cypher.Relationship({ type: "ACTED_IN" });
Instead, Nodes and Relationships should be created without parameters. Labels and types should be set in a Pattern:
const n = new Cypher.Node();
const r = new Cypher.Relationship();
const pattern = new Cypher.Pattern(n, { labels: ["Movie"] }).related(r, { type: "ACTED_IN" }).to();
Changelog
1.15.0
0acf69b
Thanks @angrykoala! - Add support for IN TRANSACTIONS
in CALL statements using the method inTransactions()