Env - Neo4j 4.0 enterprise
OS - Linux
Plugins - GDS and apoc
I have a data in neo4j like below -
CREATE (a:hotel {hotel_id:'A'}),
(b:hotel {hotel_id:'B'}),
(c:hotel {hotel_id:'C'}),
(d:hotel {hotel_id:'D'}),
(e:hotel {hotel_id:'E'}),
(f:hotel {hotel_id:'F'}),
(g:hotel {hotel_id:'G'}),
(h:hotel {hotel_id:'H'}),
(i:hotel {hotel_id:'I'}),
(a)-[:HAS]->(b),
(b)-[:HAS]->(c),
(c)-[:HAS]->(d),
(d)-[:HAS]->(e),
(e)-[:HAS]->(f),
(f)-[:HAS]->(g),
(g)-[:HAS]->(h),
(h)-[:HAS]->(i),
(ap:hotel_loc {loc_id:'pp1A'}),
(bp:hotel_loc {loc_id:'pp1B'}),
(cp:hotel_loc {loc_id:'pp1C'}),
(dp:hotel_loc {loc_id:'pp1D'}),
(ep:hotel_loc {loc_id:'pp1E'}),
(fp:hotel_loc {loc_id:'pp1F'}),
(gp:hotel_loc {loc_id:'pp1G'}),
(hp:hotel_loc {loc_id:'pp1H'}),
(ip:hotel_loc {loc_id:'pp1I'}),
(a)-[:HAS_JUNC]->(ap),
(b)-[:HAS_JUNC]->(bp),
(c)-[:HAS_JUNC]->(cp),
(d)-[:HAS_JUNC]->(dp),
(e)-[:HAS_JUNC]->(ep),
(f)-[:HAS_JUNC]->(fp),
(g)-[:HAS_JUNC]->(gp),
(h)-[:HAS_JUNC]->(hp),
(i)-[:HAS_JUNC]->(ip);
2 scenerios 1. List of the all node starting from given a loc_id (example pp1F
), i need to get all the nodes(hotel) and their associated :HAS_JUNC nodes.
f,pp1F
g,pp1G
h,pp1H
i,pp1I
- List of all until the end. given a loc_id (example
pp1C
), i need to all the nodes until pp1C
a,pp1A
b,pp1B
c,pp1C
Any help is highly appreciated.
@lyonwj