此查询正在为数组中的'DOWNLOAD'
匹配单个属性值content
:
MATCH (profile:Profile)
MATCH (profile)-[:LINK]->(l)
WHERE ANY(content IN l.content WHERE content = 'DOWNLOAD')
RETURN DISTINCT profile
但是当在'DOWNLOAD'
中包含'RECENT'
时,content
和type
的多个属性值AND
和WHERE ANY()
出现错误:< / p>
MATCH (profile:Profile)
MATCH (profile)-[:LINK]->(l)
WHERE ANY(content IN l.content WHERE content = 'DOWNLOAD'
AND type IN l.type WHERE type = 'RECENT')
RETURN DISTINCT profile
答案 0 :(得分:2)
To check if an element exists in a list, you can use the IN operator:
MATCH
(profile:Profile)
MATCH
(profile)-[:LINK]->(l)
WHERE
'DOWNLOAD' IN l.content AND
'RECENT' IN l.type
RETURN
DISTINCT profile