Return the start node and end node of every realtions

HI all,

I need to update this query so that its returns the start node and end node of every realtionships the below is returning and also some properties of those start and end nodes

match p = (a:MatPlant)-[r*0..20]->(b:MatPlant) where b.matl_num='428en11201' and b.plnt_cd = 'US456789033' return p

Could anyone please help

You can use this

match p = (a:MatPlant)-[*0..20]->(b:MatPlant) 
where b.matl_num='428en11201' and b.plnt_cd = 'US456789033' 
unwind relationships(path) as r
return type(r), startNode(r).matl_num, endNode(r).plnt_cd

// or

match p = (a:MatPlant)-[*0..20]->(b:MatPlant) 
where b.matl_num='428en11201' and b.plnt_cd = 'US456789033' 
unwind relationships(path) as r
with r, startNode(r) as start, endNode(r) as end
return type(r), start { .* } as startProps, end {.*, .plnt_cd} as endProps