I have a timeline type query that retrieves messages and users who “love” the message.
START me=node:node_auto_index(UserIdentifier='USER0') MATCH me-[rels:FOLLOWS*0..1]-myfriend WITH myfriend MATCH myfriend-[:POSTED*]-statusupdates<-[r?:LIKE]-likers WHERE myfriend <> statusupdates RETURN distinct statusupdates, FILTER (x in collect(distinct likers) : x <> null), myfriend ORDER BY statusupdates.PostTime DESC LIMIT 25;
I limit the number of messages I receive to 25. I would also like to limit the number of users who liked the post. Is there a way to use multiple constraints in a query? Ideally, I would like to do something like the following:
START me=node:node_auto_index(UserIdentifier='USER0') MATCH me-[rels:FOLLOWS*0..1]-myfriend WITH myfriendMATCH myfriend-[:POSTED*]-statusupdates<-[r?:LIKE]-likers WHERE myfriend <> statusupdates RETURN distinct statusupdates, LIMIT FILTER (x in collect(distinct likers) : x <> null) 6, myfriend ORDER BY statusupdates.PostTime DESC LIMIT 25;
Or:
START me=node:node_auto_index(UserIdentifier='USER0') MATCH me-[rels:FOLLOWS*0..1]-myfriend WITH myfriendMATCH myfriend-[:POSTED*]-statusupdates<-[r?:LIKE]-likers WHERE myfriend <> statusupdates RETURN distinct statusupdates, FILTER (x in collect(distinct likers) : x <> null), myfriend LIMIT likers 6 ORDER BY statusupdates.PostTime DESC LIMIT 25;
Which would limit the number of characters returned for each message to 6. How can I achieve this?
source share