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.
The text was updated successfully, but these errors were encountered:
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.
More of a feature request than a bug.
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:
{
"results": [{
"columns": [],
"data": [],
"stats": {
"contains_updates": true,
"nodes_created": 1,
"nodes_deleted": 0,
"properties_set": 1,
"relationships_created": 0,
"relationship_deleted": 0,
"labels_added": 1,
"labels_removed": 0,
"indexes_added": 0,
"indexes_removed": 0,
"constraints_added": 0,
"constraints_removed": 0
}
}],
"errors": []
}
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.
The text was updated successfully, but these errors were encountered: