cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

How to get the order of a query result

I have a simple question I wasn't able to answer:

Imagine I have a query.

MATCH (x:X)
   WITH x 
   ORDER BY x.prop

return counter(x), X

where the counter is a number from 0/1 up to the number of the results.

In other words, I want to added a column which represent a counter, so I can later rearrange the results, but maintaining the original reference and then being able to directly access the array of the result.

Is a crazy idea or someone know how to achieve that?

Thanks

1 ACCEPTED SOLUTION

Bennu
Graph Fellow

Hi @paolodipietro58 !

You may find this link useful!

Bennu

View solution in original post

2 REPLIES 2

Bennu
Graph Fellow

Hi @paolodipietro58 !

You may find this link useful!

Bennu

Well, seem to be too difficult to implement due to the parallelism.
I solved implementing it in javascript.
But is interesting to discover not to be alone into the universe 😉