To minimize the necessary matches, you can try the following:
MATCH (c { type: 'sometype'}) WITH c LIMIT 100 WITH COLLECT(c) as cNodes UNWIND cNodes as c1 MATCH (c1)-[r]->(c2) WHERE c2 in cNodes RETURN c1, TYPE(r) as rel, c2
As already mentioned, matching without labels is not recommended, since all nodes should be scanned, as the size of db grows, the query will be slower and slower. Use the shortcut in the original match, if possible, and if there is an index on the shortcut and its type property, this can be a very quick query.
source share