Skip to content

Releases: neo4j/cypher-builder

v1.17.2

24 Jul 12:01
7d936ec
Compare
Choose a tag to compare

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

28 May 10:26
bcac0f1
Compare
Choose a tag to compare

Patch Changes

  • #346 65661c3 Thanks @mjfwebb! - Add callProcedure method to With and Match clauses

    const withQuery = new Cypher.With("*").callProcedure(Cypher.db.labels()).yield("label");

v1.17.0

21 May 08:29
589ddba
Compare
Choose a tag to compare

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

03 May 07:41
5491ead
Compare
Choose a tag to compare

Minor Changes

  • #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:

Patch Changes

  • #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();

v1.15.0

28 Mar 13:48
c2bf51d
Compare
Choose a tag to compare

Minor Changes

  • #321 0acf69b Thanks @angrykoala! - Add support for IN TRANSACTIONS in CALL statements using the method inTransactions()

v1.14.0

01 Mar 11:08
fb107ac
Compare
Choose a tag to compare

Minor Changes

  • #312 3060a56 Thanks @angrykoala! - Add support for normalize function:

    Cypher.normalize(new Cypher.Param("my string"), "NFC");
    
  • #314 dbb6a4a Thanks @angrykoala! - Add isNormalized and isNotNormalized 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! - Deprecate Cypher.cdc Procedures in favor of Cypher.db.cdc:

    • Cypher.cdc.current in favor of Cypher.db.cdc.current
    • Cypher.cdc.earliest in favor of Cypher.db.cdc.earliest
    • Cypher.cdc.query in favor of Cypher.db.cdc.query

    This new procedures also update the generated Cypher namespace to db.cdc

v1.13.0

23 Feb 11:55
7577725
Compare
Choose a tag to compare

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

15 Feb 16:58
3a5f902
Compare
Choose a tag to compare

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

01 Feb 15:01
068a7d2
Compare
Choose a tag to compare

Minor Changes

  • #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

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 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);

v1.10.3

24 Jan 16:29
f68c677
Compare
Choose a tag to compare

Patch Changes

  • #279 4620a2e Thanks @angrykoala! - Add support for "*" parameter in MapProjection:

    new Cypher.MapProjection(new Cypher.Variable(), "*");
    var0 { .* }