Neo4J Cypher:从部分匹配的索引查找查询返回结果
我正在调用服务方法,我想知道是否有任何节点不存在。我不想运行多个查询Neo4J Cypher:从部分匹配的索引查找查询返回结果,neo4j,cypher,Neo4j,Cypher,我正在调用服务方法,我想知道是否有任何节点不存在。我不想运行多个查询 START l=node:node_auto_index(UserIdentifier = 'USER1'), f=node:node_auto_index(UserIdentifier = 'USER2') CREATE UNIQUE f-[fo:FOLLOWS]->l RETURN l, f, fo; 我想向客户端返回有意义的错误消息,告诉客户端“USER1”是否存在,“USER2”是否存在以及是否存在以下关系。目
START l=node:node_auto_index(UserIdentifier = 'USER1'), f=node:node_auto_index(UserIdentifier = 'USER2')
CREATE UNIQUE f-[fo:FOLLOWS]->l
RETURN l, f, fo;
我想向客户端返回有意义的错误消息,告诉客户端“USER1”是否存在,“USER2”是否存在以及是否存在以下关系。目前,如果USER1或USER2不存在,此查询将不返回任何内容。如果他们都这样做,结果是好的。我怎么回去
l = USER1
f = NULL (or equivalent value that will tell me the user doesn't exist)
fo = NULL (or equivalent value that will tell me the user doesn't exist)
如果只有USER1存在?合并(rec_part.DW_FLAG?,“NULLLLLLLL”)
您可以使用coalesce
,如下所示
因此,如果要将其与字符串
值一起使用,它可能如下所示:
START l=node:node_auto_index(UserIdentifier = 'USER1'), f=node:node_auto_index(UserIdentifier = 'USER2')
CREATE UNIQUE f-[fo:FOLLOWS]->l
RETURN coalesce(l.SOMETHING,"Value doesn't exist")
我试过了,它似乎不起作用,我想知道索引查找是否是问题所在