Exists
Cypher® EXISTS
subqueries can be created with new Cypher.Exists()
.
To do this, a valid query needs to be passed to Exists
.
Note that count subqueries can also be used as predicates in WHERE
clauses, for example:
const subquery = new Cypher.Match(new Cypher.Node({ labels: ["Movie"] })).return("*");
const existsExpression = new Cypher.Exists(subquery);
const match = new Cypher.Match(new Cypher.Node()).where(existsExpression).return("*");
MATCH (this0)
WHERE EXISTS {
MATCH (this1:Movie)
RETURN *
}
RETURN *