Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我的图表中有以下路径:
user-[:NEXT]->message(n)-[:NEXT]->message(n-1)-[:NEXT]->...-[:NEXT]->message1-[:NEXT]->message0
在这种情况下,我可以依赖以下查询中返回的消息实体的顺序吗?会永远一样吗?
start user=node(userNode) match user-[:NEXT*]->message return message
那么什么时候Paging添加呢?有关系吗?
Paging
100% 确定,您可以像这样使用 length() 函数:
start user=node(userNode) match user-[r:NEXT*]->message return message order by length(r) asc;
这将首先为您提供最短路径的列表。从最后得到它,只需使用order by length(r) desc
order by length(r) desc