Skip to content

Add Fluent support for CALL subquery #404

@JohnTheGray

Description

@JohnTheGray

CALL subquery (https://neo4j.com/docs/cypher-manual/current/clauses/call-subquery/) does not appear to be supported by ICypherFluentQuery. Furthermore, I can't find anyway to extend CypherFluentQuery to add support myself.

I can hack it by doing the following:

public static ICypherFluentQuery AggregationSubquery(this ICypherFluentQuery query)
{
    return query
        .Call("{") // Abuse CALL proc
        .Unwind(Enumerable.Range(1, 5), "i")
        .Create("(c:Clone)")
        .Return<int>("count(c) AS numberOfClones }"); // Abuse RETURN clause
}

Is there an easier was to get this working?

Ideally, the API would be something that would take a lambda to build the subquery:

public static ICypherFluentQuery AggregationSubquery(this ICypherFluentQuery query)
{
    return query
        .Call(query => query
          .Unwind(Enumerable.Range(1, 5), "i")
          .Create("(c:Clone)")
          . Return<int>("count(c) AS numberOfClones"));
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions