You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@age.apache.org by GitBox <gi...@apache.org> on 2021/12/06 14:11:18 UTC
[GitHub] [incubator-age] joefagan commented on issue #153: Collect returns an empty result.
joefagan commented on issue #153:
URL: https://github.com/apache/incubator-age/issues/153#issuecomment-986811673
@afidegnum
You shouldn't need to rely on Python to filter your results. What you're doing should work.
Would be good to see all your code.
Please test the following. If it works, then please submit all your code that doesn't work.
```
-- drop graph for cleanup between tests
SELECT * FROM ag_catalog.drop_graph('test_graph', true);
-- start from a new graph
-- create parent connected to 2 children with multiple properties
SELECT * FROM create_graph('test_graph');
SELECT * FROM cypher('test_graph', $$
CREATE (p:person {name: 'parent'})
CREATE (c1:person {name: 'child1', age: 11 })
CREATE (c2:person {name: 'child2', age: 12 })
CREATE (p)-[:connect]->(c1)
CREATE (p)-[:connect]->(c2)
RETURN p
$$) as (p agtype);
-- collect a property of children
SELECT * from cypher('test_graph', $$
MATCH (p)-[connect]->(c)
RETURN p.name,collect(c.name)
$$) as (p agtype, c agtype);
```
Last query should return
p | c
----------+----------------------
"parent" | ["child2", "child1"]
(1 row)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org