I have been developing a javascript wrapper library over neo4j-driver. Though I was facing a little difficulty to obtain all the nodes using the api.
The query does work in neo4j browser, but returns only a single node using neo4j-driver.
MATCH (n) MATCH (n)-[r]-(p) RETURN p
My question: Is there another way(another query) that could return me all the connected nodes?
You have an issue with the response you get from neo4j-driver library as the Cypher Query returns all nodes, as per the relation, i.e, MATCH (n) MATCH (n)-[r]-(p) RETURN p, returns all nodes connected to (n).
Check the way you are parsing the result from the neo4j-driver.