Releases: neo4j/cypher-builder
v1.17.2
Patch Changes
-
#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
v1.17.1
v1.17.0
Minor Changes
-
#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()
v1.16.0
Minor Changes
-
#333
2593296
Thanks @mjfwebb! - Adds support for genai functiongenai.vector.encode()
and proceduregenai.vector.encodeBatch()
-
#328
628ec62
Thanks @mjfwebb! - Adds support for vector index functionsdb.index.vector.queryNodes()
anddb.index.vector.queryRelationships()
-
#310
13fd317
Thanks @angrykoala! - Add support for arbitrary variables in Patterns instead of only Node and Relationship:
Patch Changes
-
#310
13fd317
Thanks @angrykoala! - The following methods inPattern
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();
v1.15.0
Minor Changes
- #321
0acf69b
Thanks @angrykoala! - Add support forIN TRANSACTIONS
in CALL statements using the methodinTransactions()
v1.14.0
Minor Changes
-
#312
3060a56
Thanks @angrykoala! - Add support fornormalize
function:Cypher.normalize(new Cypher.Param("my string"), "NFC");
-
#314
dbb6a4a
Thanks @angrykoala! - AddisNormalized
andisNotNormalized
operators:const stringLiteral = new Cypher.Literal("the \\u212B char"); const query = new Cypher.Return([Cypher.isNormalized(stringLiteral, "NFC"), "normalized"]); const { cypher } = query.build(); RETURN "the \u212B char" IS NFC NORMALIZED AS normalized
Patch Changes
-
#315
e3a7505
Thanks @angrykoala! - DeprecateCypher.cdc
Procedures in favor ofCypher.db.cdc
:Cypher.cdc.current
in favor ofCypher.db.cdc.current
Cypher.cdc.earliest
in favor ofCypher.db.cdc.earliest
Cypher.cdc.query
in favor ofCypher.db.cdc.query
This new procedures also update the generated Cypher namespace to
db.cdc
v1.13.0
Minor Changes
-
#301
f2f679b
Thanks @angrykoala! - Add support for Collect subqueries:const dog = new Cypher.Node({ labels: ["Dog"] }); const person = new Cypher.Node({ labels: ["Person"] }); const subquery = new Cypher.Match( new Cypher.Pattern(person) .related(new Cypher.Relationship({ type: "HAS_DOG" })) .to(dog), ).return(dog.property("name")); const match = new Cypher.Match(person) .where(Cypher.in(new Cypher.Literal("Ozzy"), new Cypher.Collect(subquery))) .return(person);
MATCH (this0:Person) WHERE "Ozzy" IN COLLECT { MATCH (this0:Person)-[this1:HAS_DOG]->(this2:Dog) RETURN this2.name } RETURN this0
v1.12.0
Minor Changes
-
#294
07280b6
Thanks @angrykoala! - Support for WHERE predicates in patters:const movie = new Cypher.Node({ labels: ["Movie"] }); new Cypher.Pattern(movie).where( Cypher.eq(movie.property("title"), new Cypher.Literal("The Matrix")), );
(this0:Movie WHERE this0.title = "The Matrix")
v1.11.0
Minor Changes
-
#277
f97c229
Thanks @angrykoala! - Add support for type predicate expressions with the functionsCypher.isType
andCypher.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
Patch Changes
-
#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 subqueryCALL { WITH var0 MATCH (this1:Movie) RETURN this1 AS var2 UNION WITH var0 MATCH (this3:Movie) RETURN this3 AS var2 }
-
#283
566e1d4
Thanks @angrykoala! - DeprecateCall.innerWith
in favor ofCall.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);
v1.10.3
Patch Changes
-
#279
4620a2e
Thanks @angrykoala! - Add support for "*" parameter in MapProjection:new Cypher.MapProjection(new Cypher.Variable(), "*");
var0 { .* }