You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently if you do a MATCH and SET without a RETURN statement in a cypher query it is not possible to know whether the SET was successful or not (e.g. due to a failed match). The REST API has a "stats" field that contains this information e.g:
But this is never exposed in the GraphDatabase.cypher() callback. The only workaround right now that I know of is to add a RETURN statement which adds an unnecessary penalty hit.
Btw, FWIW, we at @fiftythree do RETURN in order to get this info, but it doesn't have to be a penalty hit: you can always RETURN COUNT(foo), which is usually the same info as the stat you're interested in.
E.g. unfollow and return whether unfollowed (or wasn't following in the first place):
MATCH (a:User ...) -[r:follows]-> (b:User ...)
DELETErRETURNCOUNT(r)
That returns 1 if a relationship was found and deleted, 0 if not.
Activity
aseemk commentedon Jul 6, 2015
Nice idea! I was only vaguely aware of
stats, but haven't experienced it myself. How do you get it?aseemk commentedon Jul 6, 2015
Btw, FWIW, we at @fiftythree do
RETURNin order to get this info, but it doesn't have to be a penalty hit: you can alwaysRETURN COUNT(foo), which is usually the same info as the stat you're interested in.E.g. unfollow and return whether unfollowed (or wasn't following in the first place):
That returns 1 if a relationship was found and deleted, 0 if not.
[-]MATCH and SET without RETURN returns ambiguous result[/-][+]Cypher stats[/+]sagdelen commentedon Apr 1, 2016
It would be very nice to have this kind of stats optionally.