Closed cotran2 closed 3 years ago
Hi
Can you flatten the results?
What are you doing with the data you collect()?
Can you share the cypher query?
On Oct 23, 2020, at 12:21 PM, Co Tran notifications@github.com wrote:
I have no problems using neo4r for most of my queries except for those returning collect(properties) as something, the error is always Error in .x[[i]] : subscript out of bounds. I can use these queries on my neo4j server without any problems. Could someone look into this and help me out? Much appreciated.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/neo4j-rstats/neo4r/issues/80, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBXAGFPWTESZ4HUUJFS5B3SMGURRANCNFSM4S4YOFSA.
Here is the query
MATCH (r:Role)-[:ROLE_HAS_ENT_2020]->(e:Entitlement)
WITH COLLECT(r.role) AS associated_roles
MATCH (r:Role)-[:ROLE_HAS_ENT_%s]->(e:Entitlement)
WHERE r.role IN associated_roles
RETURN r.role AS rid_associated, COUNT(e.entitlement) AS n_ent, COLLECT(e.entitlement) AS eids_associated
I can run this on my neo4j server but not by using neo4r. If I remove the last part, COLLECT(e.entitlement) AS eids_associated
, it runs fine with neo4r.
The tibble doesn’t seem to be able to handle arrays in a single element, but I’m not an expert there. Cypher I know :-)
This will flatten the response given you one eid_associated per row.
MATCH (r:Role)-[:ROLE_HAS_ENT_2020]->(e:Entitlement) MATCH (r:Role)-[:ROLE_HAS_ENT_S]->(e:Entitlement) WITH r.role AS rid_associated, COUNT(e.entitlement) AS n_ent, COLLECT(e.entitlement) AS eids_associated UNWIND eids_associated as eid_associated return rid_associated,n_ent, eid_associated
HTH
On Oct 23, 2020, at 1:22 PM, Co Tran notifications@github.com wrote:
Here is the query
MATCH (r:Role)-[:ROLE_HAS_ENT_2020]->(e:Entitlement) WITH COLLECT(r.role) AS associated_roles MATCH (r:Role)-[:ROLE_HASENT%s]->(e:Entitlement) WHERE r.role IN associated_roles RETURN r.role AS rid_associated, COUNT(e.entitlement) AS n_ent, COLLECT(e.entitlement) AS eids_associated I can run this on my neo4j server but not by using neo4r. If I remove the last part, COLLECT(e.entitlement) AS eids_associated, it runs fine with neo4r.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/neo4j-rstats/neo4r/issues/80#issuecomment-715471849, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFBXAGFZJBG5ITBMI73FAFDSMG3WFANCNFSM4S4YOFSA.
Thanks a lot! This works for me!
I have no problems using neo4r for most of my queries except for those returning
collect(properties) as something
, the error is alwaysError in .x[[i]] : subscript out of bounds
. I can use these queries on my neo4j server without any problems. Could someone look into this and help me out? Much appreciated.