Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
跳过Cypher Neo4j中的收集_Neo4j_Cypher_Spring Data Neo4j - Fatal编程技术网

跳过Cypher Neo4j中的收集

跳过Cypher Neo4j中的收集,neo4j,cypher,spring-data-neo4j,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

这是我的密码查询

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
with
一起使用,从而在创建集合之前限制通知:

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

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

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

谢谢@Christophe,它工作得很好。我想再问一件事,我们能优化这个查询并比这个查询得到更快的响应吗。我是cypher新手,需要更多提示以更快或正确的方式获得响应。如果您在notification.type和/或statusThank@Christophe上创建索引,则工作正常。我想再问一件事,我们能优化这个查询并比这个查询得到更快的响应吗。我是cypher新手,需要更多提示以更快或正确的方式获得响应来编写查询。如果您在notification.type和/或status上创建索引