cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

need to create node for all blank key properties but properties might add in near future

need to create node for all blank key properties but properties might add in near future

query I am using:

match (cus:Customer) where con.name is null and con.add is null and con.id is null with cus

merge (c:child) with cus,c

merge (c)-[:HAS_CONSUMER_LINK]->(cus)

I want to check all the key properties if all are null then I need to create a node and create realtionship from that node to customers could you please suggest on this.

 

1 REPLY 1

You can use the 'all' predicate as shown in the following query:

match(n)
where all(i in keys(n) where n[i] is null)
return n

I am curious why you have nodes with no properties. And, then you are creating another node with no properties and linking the two. Nodes without properties don't convey information. Also, having multiple nodes without properties adds ambiguity. 

What is your data model?