We're using Neo 4.4.3 and following the suggestions here, we're using the following as a way to get count of related nodes in the fastest possible way (as suggested here):
MATCH (c:Node {id: $nodeId})
RETURN size((c)-[:CONTAINS]->())
However, we're getting a warning
A pattern expression should only be used in order to test the existence of a pattern. It should therefore only be used in contexts that evaluate to a boolean, e.g. inside the function exists() or in a WHERE-clause. All other uses are deprecated and should be replaced by a pattern comprehension.
Problem is, all the alternatives detailed here are noticeable much, much slower and this is a time critical part of our front end.
Any suggestions as to have an alternative that does not trigger the deprecation warning?