Issue counting nodes or relationships when count is 0
Hi all,
Having a bit of an issue with Spring Datagraph.
Given the following:
Code:
@NodeEntity
User {
// ...
@Query("start user=(%start) match (user)-[:MADE_DONATION]->() return count(*)")
private int totalDonations;
public int getTotalDonations() {
return totalDonations;
}
// ...
}
I get the following when invoking getTotalDonations() IF the user doesn't HAVE any such relationships.
java.lang.IllegalStateException: Expected at least one result, got none.
This seems wrong. Shouldn't I get back 0? Is there a better way to do what I'm trying to do?
Any help is appreciated.
Kent Rancourt
DevOps Engineer