Neo4j: Match multiple labels (2 or more)

后端 未结 6 1100
轮回少年
轮回少年 2020-12-07 22:14

I would like to do a search, and I would like to start traversing from 2 labels (OR condition). For example, I need to find out all the nodes which have labels either \'Male

6条回答
  •  情歌与酒
    2020-12-07 22:44

    If you want to filter node by multiple labels with OR or IN condition, use this code:

    MATCH (n)
    WHERE labels(n) in [['Male'],['Female']]
    AND n.name =~ '.ail.'
    RETURN n
    

提交回复
热议问题