graph-explorer icon indicating copy to clipboard operation
graph-explorer copied to clipboard

[Task] Simplify "All" node types search query

Open kmcginnes opened this issue 6 months ago • 0 comments

When searching using the "All" node label type, we must ensure the resulting set of nodes has a label.

Rather than enforcing all label types:

MATCH (v)
WHERE (v:`Airport` OR v:`Country` OR v:`Region`)
RETURN v AS object
LIMIT 10

We can filter out unlabelled nodes by checking the label set size

MATCH (v)
WHERE size(labels(v)) > 0
RETURN v AS object
LIMIT 10

kmcginnes avatar Aug 01 '24 23:08 kmcginnes