lint and correct cypher query code
This commit is contained in:
@@ -154,13 +154,22 @@ CREATE (e)-[:AUTHORED_BY]->(a)
|
||||
paramName := fmt.Sprintf("eTag_%d", eTagIndex)
|
||||
params[paramName] = tagValue
|
||||
|
||||
// Add WITH clause before first OPTIONAL MATCH to transition from CREATE to MATCH
|
||||
// Add WITH clause before OPTIONAL MATCH
|
||||
// This is required because:
|
||||
// 1. Cypher doesn't allow MATCH after CREATE without WITH
|
||||
// 2. Cypher doesn't allow MATCH after FOREACH without WITH
|
||||
// So we need WITH before EVERY OPTIONAL MATCH, not just the first
|
||||
if needsWithClause {
|
||||
cypher += `
|
||||
// Carry forward event and author nodes for tag processing
|
||||
WITH e, a
|
||||
`
|
||||
needsWithClause = false
|
||||
} else {
|
||||
// After a FOREACH, we need WITH to transition back to MATCH
|
||||
cypher += `
|
||||
WITH e, a
|
||||
`
|
||||
}
|
||||
|
||||
cypher += fmt.Sprintf(`
|
||||
|
||||
Reference in New Issue
Block a user