diff --git a/docs/source/integration.rst b/docs/source/integration.rst index 9e91a263..26eb9d5c 100644 --- a/docs/source/integration.rst +++ b/docs/source/integration.rst @@ -183,7 +183,7 @@ In this small example, we import a graph from a Neo4j query result. .. code-block:: python - from neo4j import GraphDataScience + from neo4j import GraphDatabase, RoutingControl, Result from neo4j_viz.gds import from_gds # Modify this to match your Neo4j instance's URI and credentials @@ -196,6 +196,7 @@ In this small example, we import a graph from a Neo4j query result. result = driver.execute_query( "MATCH (n)-[r]->(m) RETURN n,r,m", database_="neo4j", + routing_=RoutingControl.READ, result_transformer_=Result.graph, ) diff --git a/examples/neo4j-example.ipynb b/examples/neo4j-example.ipynb index 3b0240ff..abce0ad9 100644 --- a/examples/neo4j-example.ipynb +++ b/examples/neo4j-example.ipynb @@ -44,8 +44,6 @@ "source": [ "import os\n", "\n", - "from neo4j import GraphDatabase, Result\n", - "\n", "URI = os.environ.get(\"NEO4J_URI\", \"bolt://localhost:7687\")\n", "\n", "auth = None\n", @@ -68,6 +66,8 @@ "metadata": {}, "outputs": [], "source": [ + "from neo4j import GraphDatabase\n", + "\n", "with GraphDatabase.driver(URI, auth=auth) as driver:\n", " driver.verify_connectivity()\n", " driver.execute_query(\n", @@ -130,12 +130,15 @@ "metadata": {}, "outputs": [], "source": [ + "from neo4j import Result, RoutingControl\n", + "\n", "with GraphDatabase.driver(URI, auth=auth) as driver:\n", " driver.verify_connectivity()\n", "\n", " result = driver.execute_query(\n", " \"MATCH (n)-[r]->(m) RETURN n,r,m\",\n", " database_=\"neo4j\",\n", + " routing_=RoutingControl.READ,\n", " result_transformer_=Result.graph,\n", " )\n", "\n",