Skip to content Skip to sidebar Skip to footer

Order By Relationship Properties Neo4j

Using Neo4j 1.9.3 - I want to create a music program listing. On a given program there may be three pieces being performed. Each piece has a composer associated with them, and may

Solution 1:

If you like it, lock it down: that is, bind it to a variable. Then you can use ORDER BY the same way you would with node properties. If you have retrieved your program as (program1) you can do something like

MATCH (program1)-[r:PROGRAM_PIECE]->(piece1)
  RETURN program1, r, piece1
  ORDER BY r.program_seq

Solution 2:

I have done the same thing recently to keep track of chess moves in a particular game. It is the same thing as node properties.

start program = node(*) // or better yet, use a real index query to find the program
match (program)-[program_piece:PROGRAM_PIECE]->(piece)
return program, piece
order by program_piece.program_seq

Post a Comment for "Order By Relationship Properties Neo4j"