我正在尝试在密码中执行条件查询下面是我的示例查询,但即使条件为真,它也不会创建新的对话节点。
WITH ["Ram", "Shyam", "Hari"] as names
WITH names, size(names) AS requiredCount
MATCH (u:User) WHERE u.name IN names
WITH u, requiredCount
MATCH (u)-[:IS_PARTICIPANT]->(c:Conversation)
WITH requiredCount, c, u, count(u) as matches
WHERE requiredCount = matches and size(()-[:IS_PARTICIPANT]->(c)) = requiredCount
WITH u, count(c) as conversationExists
CALL apoc.do.when(conversationExists < 1, 'MERGE (cc:Conversation {_id:
apoc.create.uuid(), createdAt: timestamp()}) RETURN cc', '', {u: u}) YIELD value
RETURN value