Neo4j, get all relationships between a set of nodes

后端 未结 6 1137
遥遥无期
遥遥无期 2021-01-05 00:13

I\'ve a query that fetches nodes based on a property

MATCH (c { type: \'sometype\' })
WITH c LIMIT 100
RETURN c

all I want is to also fetch

6条回答
  •  难免孤独
    2021-01-05 01:07

    The most fastest way that i found is:

     MATCH (n:NodeName {param:"7"})
            with n
            skip 0
            limit 5
            MATCH n-[r]->(k)
            with n,k,r
    

    Also you can decrease execution time if for example instead of n,k,r will use n.data,r.data, k.data

    This was tested on Neo4j 2.3

提交回复
热议问题