Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@neo4j/cypher-builder

Package Overview
Dependencies
Maintainers
6
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neo4j/cypher-builder - npm Package Versions

23
7

2.0.1

Diff

Changelog

Source

2.0.1

Patch Changes

neo4j-organization
published 2.0.0 •

Changelog

Source

2.0.0

Major Changes

  • #389 88f4928 Thanks @angrykoala! - Patterns no longer create a variable by default

    const pattern = new Cypher.Pattern();
    

    Before:

    (this0)
    

    Now:

    ()
    
  • #390 038d8b5 Thanks @angrykoala! - Clause build options are now passed as an object rather than parameters:

    myClause.build({
        prefix: "another-this",
        extraParams: {
            myParam: "hello",
        },
        labelOperator: "&",
    });
    

    All parameters are optional, and build can still be called without parameters

  • #389 f5135f5 Thanks @angrykoala! - Remove support for adding new columns into an existing with clause with .with, the method addColumns should be used instead

  • #408 bba9d81 Thanks @angrykoala! - Escape literal strings if they contain invalid characters:

    new Cypher.Literal(`Hello "World"`);
    

    Would get translated into the following Cypher:

    "Hello \"World\""
    
  • #409 adf599f Thanks @angrykoala! - Cypher.Raw no longer exposes Cypher.Environment variable. It provides a CypherRawContext instance with a compile method to compile nested elements in custom cypher instead

  • #407 88a300a Thanks @angrykoala! - Remove method Cypher.concat, Cypher.utils.concat should be used instead

  • #447 b82be57 Thanks @angrykoala! - Remove Path and NamedPath in favor of PathVariable and NamedPathVariable

  • #389 f5135f5 Thanks @angrykoala! - Removes the following deprecated features:

    • pointDistance
    • utils.compileCypher
    • RawCypher
    • onCreate method in Merge clauses
    • innerWith method in Call clauses
    • PatternComprehension second parameter
    • cdc namespace:
      • cdc.current
      • cdc.earliest
      • cdc.query
    • rTrim and lTrim
    • Pattern.withoutLabels
    • Pattern.withoutVariable
    • Pattern.withProperties
    • Pattern.withVariables
    • Pattern.related().withoutType
    • Pattern.related().withDirection
    • Pattern.related().withLength
    • Pattern.related().getVariables
    • Relationship.type
    • Labels, types and properties in Node and Relationship classes
    • Using Node directly in constructor of clauses
  • #453 f8a8120 Thanks @angrykoala! - Remove support for fine-grained prefix configuration

    No longer supported:

    myClause.build({
        variable: "var_prefix_",
        params: "param_prefix_",
    });
    
  • #410 961933f Thanks @angrykoala! - Removes previous argument from Pattern constructor. This argument was never meant to be used externally and now it is not accessible

  • #391 d416ee6 Thanks @angrykoala! - Fix TypeScript typings for boolean operators when using array spread:

    • Cypher.and
    • Cypher.or
    • Cypher.xor

    The following:

    const predicates: Cypher.Predicate[] = [];
    const andPredicate = Cypher.and(...predicates);
    

    Will now return the correct type Cypher.Predicate | undefined. This change means that additional checks may be needed when using boolean operators:

    const predicates = [Cypher.true, Cypher.false];
    const andPredicate = Cypher.and(...predicates); // type Cypher.Predicate | undefined
    

    Passing parameters without spread will still return a defined type

  • #447 b82be57 Thanks @angrykoala! - Remove assignToPath method from clauses, in favor of assignTo in Patterns for the following clauses:

    • Match
    • Merge
    • Create

    Before:

    new Cypher.Match(pattern).assignToPath(pathVariable).return(pathVariable);
    

    Now:

    new Cypher.Match(pattern.assignTo(pathVariable)).return(pathVariable);
    

    Generates the Cypher:

    MATCH p = ()-[]-()
    RETURN p
    

Patch Changes

neo4j-organization
published 1.22.4 •

Changelog

Source

1.22.4

Patch Changes

  • #451 e0d7f4b Thanks @angrykoala! - Deprecates CypherEnvironment exported types in favor of RawCypherContext for usage in Cypher.Raw
neo4j-organization
published 1.22.3 •

Changelog

Source

1.22.3

Patch Changes

  • #444 be3c49e Thanks @angrykoala! - Deprecate assignToPath in clauses in favor of assignTo in Pattern

    Before:

    new Cypher.Match(pattern).assignToPath(path).return(path);
    

    Now:

    new Cypher.Match(pattern.assignTo(path)).return(path);
    

    Generates the Cypher:

    MATCH p = ()-[]-()
    RETURN p
    
  • #444 0a5bf6c Thanks @angrykoala! - Deprecate Cypher.Path and Cypher.NamedPath in favor of Cypher.PathVariable and Cypher.NamedPathVariable respectively

neo4j-organization
published 1.22.2 •

Changelog

Source

1.22.2

Patch Changes

  • #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))
    
neo4j-organization
published 1.22.1 •

Changelog

Source

1.22.1

Patch Changes

  • #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);
    
neo4j-organization
published 1.22.0 •

Changelog

Source

1.22.0

Minor Changes

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

Patch Changes

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

    • Call
    • Merge
    • Create
    • Match
    • Unwind
    • Procedures
neo4j-organization
published 1.21.0 •

Changelog

Source

1.21.0

Minor Changes

  • #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
    
neo4j-organization
published 1.20.1 •

Changelog

Source

1.20.1

Patch Changes

neo4j-organization
published 1.20.0 •

Changelog

Source

1.20.0

Minor Changes

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

Patch Changes

  • #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
23
7
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc