I have simplified my complex cypher down its core issue.
START focus=node(2), user=node(20)
MATCH focus-[:USER_FEED_LIST*1..15]->pointer-[:POINTER]->item,
item-[l?:NOTICE_LINK]->link<-[lu?:POST_UPVOTE]-user
RETURN link, ID(item) as item_id, item, l, lu
Basically what I am trying to achieve is as follows:
- return each item in the linked list
- for each item, return
l
andlink
if they exist, or null if not - if
link
is not null, returnlu
anduser
if they exist, or null if not
The problem I am having is with 3.
as the third line of the query is really saying return any link that satisfies either of the given relationships.
So for example, if my linked list chained 10 items, I need the query to always return 10 rows (null for l
, link
and lu
if they don't exist).