neo4j-cql

Neo4j - Get Level2 or Level3 connections

风格不统一 提交于 2019-12-25 07:27:48
问题 I'm developing a small connections structure to understand the concept of graph databases better, as well learn Neo4J I have few users and the relationship between them is KNOWS as follows I have the following cqls to create the nodes and relationships between then in Neo4j. CREATE (user1:User {name:"User1",mail:"user1@test.com",mobile: 9000090001}) CREATE (user2:User {name:"User2",mail:"user2@test.com",mobile: 9000090002}) CREATE (user3:User {name:"User3",mail:"user3@test.com",mobile:

level-2 or level-3 connections when we have bidirectional relationship

别说谁变了你拦得住时间么 提交于 2019-12-12 03:26:42
问题 Extention to this question Neo4j - Get Level2 or Level3 connections I have the following relationship in Neo4j. Few nodes have bidirectional relationsips I want to fetch the level-2 or level-3 connections for the given user. I have the following CQL START levelGraph=node(1) MATCH path=(user1:User)-[knows:KNOWS*2..2]->(user2:User) WHERE user1.mobile = 9000090001 RETURN user1, user2, length(path) as downlevel ORDER BY length(path) asc this one is giving me all the nodes who has relationship