Hi Michael,
thank you very much for precious information.

I'm still trying to have ordered 2 level subqueries, but without success.

This works OK:
neo4j-sh (?)$ MATCH (post:Post)
> WITH post
> ORDER BY post.updated_at DESC LIMIT 5
> OPTIONAL MATCH post-[:posted_photos]->photo
> OPTIONAL MATCH photo-[:sizes]-(size220{x:220,method:4})
> WITH post, photo, size220
> ORDER BY photo.created_at DESC
> 
> WITH post, collect(photo.created_at)[0..5] as photos
> 
> RETURN ID(post),post.updated_at, photos
> ORDER BY post.updated_at DESC;
+----------------------------------------------------------------------------------------------------------------------------------------------------+
| ID(post) | post.updated_at | photos |
+----------------------------------------------------------------------------------------------------------------------------------------------------+
| 69741 | "2015-03-15 23:59:13" | ["2015-03-15 23:59:13","2015-03-15 
23:58:39","2015-03-15 23:48:21","2015-03-15 23:40:30","2015-03-15 
23:19:30"] |
| 1193 | "2015-03-15 23:41:21" | ["2015-02-13 0:08:32"] |



But with size220 in 'with', it is not well ordered. 
> WITH post, collect(photo.created_at)[0..5] as photos,size220

+------------------------------------------------------------+
| ID(post) | post.updated_at | photos |
+------------------------------------------------------------+
| 69741 | "2015-03-15 23:59:13" | ["2015-03-15 23:59:13"] |
| 69741 | "2015-03-15 23:59:13" | ["2015-03-15 23:48:21"] |
| 69741 | "2015-03-15 23:59:13" | ["2015-03-15 23:19:30"] |
| 69741 | "2015-03-15 23:59:13" | ["2015-03-15 23:58:39"] |
| 69741 | "2015-03-15 23:59:13" | ["2015-03-15 23:19:30"] |
| 69741 | "2015-03-15 23:59:13" | ["2015-03-15 23:40:30"] |


Any advice? Thanks in advance.
Daniel

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to