Efficiently Querying Neighboring Nodes in Neo4j Without Specific Labels or Types

How can I efficiently query neighboring nodes in Neo4j when the nodes don't have a specific label or type?

If you have a node, like "John Smith" in the example below, you can find all the neighboring nodes (independent of labels or relationship types) like this:

MATCH (p:Person {name: "John Smith"})
MATCH (p)--(neighbor)
RETURN neighbor
1 Like