So I have a list of lists as a property. Like so:
SELECT * FROM cypher('list_test', $$
CREATE(a: person {nickname: [['thomas', 'tomtom'], ['tom', 'tommy']]})
RETURN a
$$) as (timothy agtype);
I have tried the following queries:
SELECT * FROM cypher('list_test', $$
MATCH(name)
UNWIND(name.nickname) as n
WHERE 'thomas' in UNWIND(n)
RETURN nnn
$$) as result;
But I get syntax error with this.
ERROR: syntax error at or near "WHERE"
LINE 2: MATCH(name) UNWIND(name.nickname) as n WHERE 'thomas' in UNW...
2
Answers
Try this query:
According to the documentation, you have to use
agtype
as the type returned by AGE. Also, to return thenickname
list as individual rows you must useUNWIND
twice as a command, without the()
. Finally, you have to useWITH
clause withWHERE
clause.Use this query:
To return: