-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot query "collect" function #80
Comments
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 ***@***.***> 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 <#80>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AFBXAGFPWTESZ4HUUJFS5B3SMGURRANCNFSM4S4YOFSA>.
|
Here is the query
I can run this on my neo4j server but not by using neo4r. If I remove the last part, |
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 ***@***.***> 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_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.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#80 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AFBXAGFZJBG5ITBMI73FAFDSMG3WFANCNFSM4S4YOFSA>.
|
Thanks a lot! This works for me! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The text was updated successfully, but these errors were encountered: