Interface SubqueryExpressionBuilder

All Known Subinterfaces:
Expressions.SubqueryExpressionBuilder

@API(status=STABLE, since="2023.9.0") public interface SubqueryExpressionBuilder
Something that can build counting sub-queries. Might be used in the future for existential sub-queries, too.
Since:
2023.9.0
  • Method Details

    • count

      @NotNull @NotNull CountExpression count(PatternElement requiredPattern, PatternElement... patternElement)
      Creates a COUNT sub-query expressions from at least one pattern.
      Parameters:
      requiredPattern - One pattern is required
      patternElement - Optional pattern
      Returns:
      The immutable CountExpression
      Since:
      2023.9.0
    • count

      @NotNull @NotNull CountExpression count(Statement.UnionQuery union)
      Creates a COUNT with an inner UNION sub-query.
      Parameters:
      union - The union that will be the source of the COUNT sub-query
      Returns:
      The immutable CountExpression
      Since:
      2023.9.0
    • collect

      CollectExpression collect(Statement statement)
      Creates a COLLECT subquery from a statement, including its filters and conditions. The statement must return exactly one column. It must however not contain any updates. While it would render syntactically correct Cypher, Neo4j does not support updates inside counting sub-queries.

      To avoid confusion, shadowing of imported variables is not allowed. An outside scope variable is shadowed when a newly introduced variable within the inner scope is defined with the same variable.

      Parameters:
      statement - the statement to be passed to COLLECT{}
      Returns:
      a collecting sub-query.
      Since:
      2023.9.0