diff --git a/notebooks/memgraph-pydantic-simple.ipynb b/notebooks/memgraph-pydantic-simple.ipynb index ede536b..0b1eaf1 100644 --- a/notebooks/memgraph-pydantic-simple.ipynb +++ b/notebooks/memgraph-pydantic-simple.ipynb @@ -19,60 +19,15 @@ ] }, { - "cell_type": "code", - "execution_count": 4, + "cell_type": "markdown", "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "John\n", - "{'labels_added': 1, 'labels_removed': 0, 'nodes_created': 1, 'nodes_deleted': 0, 'properties_set': 0, 'relationships_created': 0, 'relationships_deleted': 0}\n", - "John\n", - "MATCH (u:User {name: $name}) RETURN u.name AS name\n" - ] - } - ], "source": [ - "from neo4j import GraphDatabase\n", - " \n", - "# Define correct URI and AUTH arguments (no AUTH by default)\n", - "URI = \"bolt://localhost:7687\"\n", - "AUTH = (\"\", \"\")\n", - " \n", - "with GraphDatabase.driver(URI, auth=AUTH) as client:\n", - " # Check the connection\n", - " client.verify_connectivity()\n", - " \n", - " # Create a user in the database\n", - " records, summary, keys = client.execute_query(\n", - " \"CREATE (u:User {name: $name, password: $password}) RETURN u.name AS name;\",\n", - " name=\"John\",\n", - " password=\"pass\",\n", - " database_=\"memgraph\",\n", - " )\n", - " \n", - " # Get the result\n", - " for record in records:\n", - " print(record[\"name\"])\n", - " \n", - " # Print the query counters\n", - " print(summary.counters)\n", - " \n", - " # Find a user John in the database\n", - " records, summary, keys = client.execute_query(\n", - " \"MATCH (u:User {name: $name}) RETURN u.name AS name\",\n", - " name=\"John\",\n", - " database_=\"memgraph\",\n", - " )\n", - " \n", - " # Get the result\n", - " for record in records:\n", - " print(record[\"name\"])\n", - " \n", - " # Print the query\n", - " print(summary.query)" + "Run MemGraph with docker:\n", + "\n", + "```bash\n", + "curl https://install.memgraph.com | sh\n", + "docker run -it memgraph/mgconsole:latest [--host HOST_IP] [--port PORT]\n", + "```" ] }, { @@ -225,6 +180,7 @@ "# Verify the data\n", "records, summary, keys = client.execute_query(\n", " \"\"\"\n", + " MATCH (p:Person)-[r]->(n)\n", " RETURN p.name as person, type(r) as relationship, n.name as target\n", " \"\"\",\n", " database_=\"memgraph\"\n", @@ -503,7 +459,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.undefined.undefined" + "version": "3.10.10" } }, "nbformat": 4,