Closed ajmeese7 closed 1 year ago
This is not a bug. Browser has a configuration called Connect result nodes
. With this options enabled, Browser does additional queries to enrich the visualisation with connected data.
@bigmontz noted, could you explain how to query relationships with the JavaScript driver then? I want to be able to fetch everything in a query, nodes and relationships alike.
Update: I know you can use MATCH (n) MATCH (n)-[r]-() RETURN n,r
to get all the nodes and their relationships from a query, that's not an issue. What I'm hoping is to have the data returned in a format that is compatible with the HTTP endpoint. I have a library that currently needs the data in the returned HTTP format.
If that's something that I need to make into a separate issue instead of discussing here, I wouldn't mind doing so, just let me know. Sorry for the confusion! :)
The only way of getting the relationship from the nodes using cypher. The Javascript Driver is responsible for the network communication with the Neo4j Database. For instance, Browser
and Bloom
use this driver for communicating with the database.
I am not able to retrieve relationships with the Neo4j JavaScript driver.
Neo4j Version: 5.1.0 Enterprise Neo4j Mode: Single instance Driver version: JS driver 5.2.0 Operating System: Zorin 16 Pro
Steps to reproduce
Run a query for
MATCH (n) RETURN n
with a JavaScript driver session.Expected behavior
The same data returned by the Neo4j Browser:
Actual behavior
No relationships are returned:
To get the above data, I used the following code (simplified):
If you're interested, this is the raw output returned by the
console.log
statement above: