age
age copied to clipboard
List comprehensions
Hey, are list comprehensions supported in AGE? Using syntax from Neo4j doesnt seem to work, simple example:
SELECT * FROM cypher('g1', $$
MATCH (v)
RETURN [x in v.array_field]
$$) as (a agtype);
You mean that this query(array_field) is working or not with AGE?
I tried that query. Once it works as 'query' (return as jsonb from Pgadmin).
But I'm not sure this result is correct(Because it returns null).
Someone who knows this issue?
You mean that this query(array_field) is working or not with AGE?
I tried that query. Once it works as 'query' (return as jsonb from Pgadmin).
But I'm not sure this result is correct(Because it returns null).
Someone who knows this issue?
array_field is some random array which is an attribute of a graph vertex. i'm trying it with AGE and receiving following error:
ERROR: variable `x` does not exist
LINE 3: RETURN [x in v.array_field]
replace x -> v and try it.
replace x -> v and try it.
no, it should be another variable: it should iterate through the array like in any list comprehension
Understood.
Maybe, that function is not supported yet now..
Hi, List Comprehensions are not currently supported
Its a useful feature. Not sure if it will be the case on AGE but with Neo4j they can especially help with performance.
List comp. was "nearly" completed until it was found to have serious issues for any nested cases. It will be revisited soon.