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

@neo4j/cypher-builder

Package Overview
Dependencies
Maintainers
7
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

1
7

1.13.0

Diff

Changelog

Source

1.13.0

Minor Changes

neo4j-organization
published 1.12.0 •

Changelog

Source

1.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")
    
neo4j-organization
published 1.11.0 •

Changelog

Source

1.11.0

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

Changelog

Source

1.10.3

Patch Changes

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

    new Cypher.MapProjection(new Cypher.Variable(), "*");
    
    var0 { .* }
    
neo4j-organization
published 1.10.2 •

Changelog

Source

1.10.2

Patch Changes

neo4j-organization
published 1.10.1 •

Changelog

Source

1.10.1

Patch Changes

  • #271 5834c61 Thanks @angrykoala! - Add labelOperator option on build to change the default label AND operator:

    const node = new Cypher.Node({ labels: ["Movie", "Film"] });
    const query = new Cypher.Match(node);
    
    const queryResult = new TestClause(query).build(
        undefined,
        {},
        {
            labelOperator: "&",
        }
    );
    

    Will return:

    MATCH (this:Movie&Film)
    
neo4j-organization
published 1.10.0 •

Changelog

Source

1.10.0

Minor Changes

  • #269 6d9d3e2 Thanks @angrykoala! - Add chained clauses to Procedures after YIELD:

    • .unwind
    • .match
    • .optionalMatch
    • .delete
    • .detachDelete
    • .set
    • .merge
    • .create
    • .remove
neo4j-organization
published 1.9.0 •

Changelog

Source

1.9.0

Minor Changes

neo4j-organization
published 1.8.0 •

Changelog

Source

1.8.0

Minor Changes

  • #253 da0b3ab Thanks @angrykoala! - Add support for type filtering on relationships

    new Cypher.Match(new Cypher.Pattern().related(new Cypher.Relationship()).to()).where(
        relationship.hasType("ACTED_IN")
    );
    
    MATCH(this0)-[this1]->(this2)
    WHERE this1:ACTED_IN
    
  • #251 80e1bca Thanks @angrykoala! - Add support for label expressions on hasLabel:

    const query = new Cypher.Match(node).where(node.hasLabel(Cypher.labelExpr.or("Movie", "Film")));
    
    MATCH (this0:Movie)
    WHERE this0:(Movie|Film)
    
  • #256 602c237 Thanks @angrykoala! - Add support for ON MATCH SET after MERGE:

    const node = new Cypher.Node({
        labels: ["MyLabel"],
    });
    
    const countProp = node.property("count");
    const query = new Cypher.Merge(node)
        .onCreateSet([countProp, new Cypher.Literal(1)])
        .onMatchSet([countProp, Cypher.plus(countProp, new Cypher.Literal(1))]);
    
    MERGE (this0:MyLabel)
    ON MATCH SET
        this0.count = (this0.count + 1)
    ON CREATE SET
        this0.count = 1
    
neo4j-organization
published 1.7.4 •

Changelog

Source

1.7.4

Patch Changes

  • #245 a63337d Thanks @angrykoala! - Deprecate Merge.onCreate in favor of Merge.onCreateSet to better reflect the resulting Cypher ON CREATE SET

  • #244 347ae01 Thanks @angrykoala! - Fix clauses order when using Merge.onCreate along with .set

    For example:

    const query = new Cypher.Merge(node)
        .onCreate([node.property("age"), new Cypher.Param(23)])
        .set([node.property("age"), new Cypher.Param(10)]);
    
    MERGE (this0:MyLabel)
    ON CREATE SET
        this0.age = $param1
    SET
        this0.age = $param0
    
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