I've noticed that sub queries and where clauses, do not get correctly intended. (at least in my opinion).
Example:
MATCH (subject:User)
WHERE (subject.id = $subjectId) OR (subject.openId = $subjectId)
CALL {
WITH subject
CALL apoc.path.expandConfig(subject, {relationshipFilter: 'IS_IN',
labelFilter: '/User',
uniqueness: 'NODE_GLOBAL'}) YIELD path
WITH nodes(path) AS nodes
UNWIND nodes AS n
WITH n
WHERE
(n.id = $userId) AND
'User' IN labels(n)
RETURN n AS s
UNION
WITH subject
RETURN subject AS s
}
WITH s
WHERE s.id = $userId
RETURN s
imo it should look like this:
MATCH (subject:User)
WHERE (subject.id = $subjectId) OR (subject.openId = $subjectId)
CALL {
WITH subject
CALL apoc.path.expandConfig(subject, {
relationshipFilter: 'IS_IN',
labelFilter: '/User',
uniqueness: 'NODE_GLOBAL'
}) YIELD path
WITH nodes(path) AS nodes
UNWIND nodes AS n
WITH n
WHERE
(n.id = $userId) AND
'User' IN labels(n)
RETURN n AS s
UNION
WITH subject
RETURN subject AS s
}
WITH s
WHERE s.id = $userId
RETURN s
(not sure on the apoc, call, no strong opinion there). The CALL {...} expresson and the WHERE expression should add an intendation imo
Hey, thanks for the plugin!
I've noticed that sub queries and where clauses, do not get correctly intended. (at least in my opinion).
Example:
imo it should look like this:
(not sure on the apoc, call, no strong opinion there). The
CALL {...}
expresson and theWHERE
expression should add an intendation imo