Find loops with datetime as relationships in increasing order

My objective is to find loops with Datetime as relationships in increasing order

load csv with headers from 'file:///file1.csv' as row

merge(m:Buyer{name:BC})

merge(n:Buyer{name:SC})

merge (m)-[ : BuysFrom{weight1: row.Datetime, weight2: row.amount}]-->(n)

return m,n

I need to find loops where Datetimes should be in increasing order. I have used the cypher like this

match p=(n)-[*1..5]->(n) return nodes(p). But unable to find Datetimes are in ASC order in the loops . Let me know some solution.

@TRRAO I didn't understand your question completely. Are you trying to find, out of all the loops, only the ones that have the Datetime in ascending order? Are you trying to find the unique loops where the "start" of the loop has the lowest possible date? Or are you trying to find something else

Hi @steggy, What you said is right. Trying to find the unique loops where the "start" of the loop has the lowest possible date.

we need to retrieve the loops such that the Datetime in edge relationships should be in ascending order. For example,

first loop -- 31-07-2014 9.00.00

Second loop -- 31-07-2014 9.15.03 and so on.

So in all the loops the Datetime ( in relationships/edges) values are in ascending order.

Thanks for your reply.

Hi @steggy I want to find all the loops. we need to retrieve the loops such that the Datetime in edge relationships should be in ascending order. For example,

first loop -- 31-07-2014 9.00.00

Second loop -- 31-07-2014 9.15.03 and so on.

So in all the loops the Datetime ( in relationships/edges) values are in ascending order.