0

I have a node with 8 properties and another node with only property under a common label. How can i match / query / display the nodes which has only property.

In other words, how can i match nodes which doesn't have more than 1 property.

2 Answers2

1

You may want something like:

MATCH (n)
WHERE size(keys(n)) = 1
RETURN n

However note that this is a graph-wide query, and likely to be expensive. Confining the query to a label may help a little.

InverseFalcon
  • 29,576
  • 4
  • 38
  • 51
  • I guess this would take a long time as it has to calculate all the keys(columns) for every node. Should work well if the data is small. – Kaushik Velusamy Jul 17 '17 at 04:19
0

As Michael Hunger mentioned

MATCH (n) WHERE NOT EXISTS(n.foo) RETURN n

Duplicate of the question : Find neo4j nodes where property is not set