Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
01-29-2023 02:56 AM
Need to check where condition properties (u.id = c.id or u.name = c.name or u.add = lc.add) dynamically as the number properties will increase in future. lets say I want to accommodate another attribute status I need check that condition also along with these. Could you please suggest on this.
below sample query I am using
01-29-2023 09:24 AM
You can use the 'any' predicate for lists to implement an 'or' for all the properties. The following query is testing if any of the properties of the child node equals the same property in the user node. If the properties of user node is not the same as the child node, then you may want to duplicate the condition one line for four the other way, to account for the different properties in the user node.
match (c:child)
match (u:User)
where not exists((c)-[:LINK]->(u))
and any(i in keys(c) where c[i]=u[i])
merge (c)-[:LINK]->(u)
return c
All the sessions of the conference are now available online