似乎我在WITH
和UNWIND
子句中定义的任何变量在子句中都不可用。
我想知道为什么这个查询返回未定义owner
。
MATCH (owner:User { id: 'b6bba33e-646a-46c2-80a2-4b6a6b5cece9' })
// Create one coaching that has two participants (WITH clause)
CREATE (coaching:Coaching {
id: randomUUID(),
subject: 'Testing coaching 1' ,
notes: 'testing this new feature',
createdAt: DateTime()
})<-[:COACHES]-(owner)
WITH ['e1d8aaef-8db6-4dc1-8f3e-1bce06463d04', '6c20b918-284c-42a9-bc6f-ab4f99a09f2f'] AS participants
UNWIND participants AS p
MATCH (participant:User { id: p })
// Create relationship participant PARTICIPATES in coaching
CREATE (coaching)<-[:PARTICIPATES]-(participant)
RETURN owner, coaching, p
Variable `owner` not defined (line 16, column 8 (offset: 536))
"RETURN owner, coaching, p"
1条答案
按热度按时间bqucvtff1#
我需要将变量添加到
WITH
子句中。