在Cypher Neo4j中跳过收集

时间:2015-01-01 17:08:16

标签: neo4j cypher spring-data-neo4j

这是我的密码查询

MATCH (notification:Notification)-[:CREATED_BY]->(user:User)
MATCH (notification)-[:NOTIFICATION_COUNTRY]->(country:Country)
WHERE notification.status='PENDING' AND notification.type='SIMPLE'
RETURN collect({id:id(notification),message:notification.message,updated:notification.lastUpdatedDate,edited:user.username,country:country.name})  as notifications
 LIMIT 25

我想通知SKIP,LIMIT。但是,我在这里收到通知的集合,所以我如何使用SKIP收集,还有其他方法吗?

1 个答案:

答案 0 :(得分:4)

您可以将SKIPLIMITWITH一起使用,从而在创建收藏集之前限制通知:

MATCH (notification:Notification)-[:CREATED_BY]->(user:User)
MATCH (notification)-[:NOTIFICATION_COUNTRY]->(country:Country)
WHERE notification.status='PENDING' AND notification.type='SIMPLE'
WITH notification
SKIP 10
LIMIT 20
RETURN collect({id:id(notification),message:notification.message,updated:notification.lastUpdatedDate,edited:user.username,country:country.name})  as notifications