This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reading CSV | |
import pandas as pd | |
csv = pd.read_csv('cluster.csv') | |
# connect with driver | |
from neo4j import GraphDatabase | |
driver = GraphDatabase.driver( | |
"neo4j+s://id.databases.neo4j.io", | |
("neo4j", "password") | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MATCH (u:User)-[:HAS_ENROLMENT]->(e:CompletedEnrolment) | |
WHERE e.completedAt >= datetime('2021-01-01') | |
WITH | |
e.completedAt.year +'-'+ e.completedAt.quarter AS quarter, | |
count(*) AS count | |
WITH collect({quarter: quarter, count: count}) AS all | |
UNWIND range(0, size(all)-1) AS idx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROFILE MATCH (m:Movie) | |
WHERE m.title STARTS WITH "Toy" | |
RETURN m.title |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a graph of episodes and guests | |
CALL apoc.load.json('https://www.learnwithjason.dev/api/episodes') | |
YIELD value | |
// | |
MERGE (e:Episode { | |
id: value._id | |
}) | |
ON CREATE SET | |
e.createdAt = datetime(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:begin | |
CREATE INDEX ON :Fixture(kickoff); | |
CREATE CONSTRAINT ON (node:Country) ASSERT (node.id) IS UNIQUE; | |
CREATE CONSTRAINT ON (node:Fixture) ASSERT (node.id) IS UNIQUE; | |
CREATE CONSTRAINT ON (node:Group) ASSERT (node.id) IS UNIQUE; | |
CREATE CONSTRAINT ON (node:Player) ASSERT (node.id) IS UNIQUE; | |
CREATE CONSTRAINT ON (node:Stadium) ASSERT (node.name) IS UNIQUE; | |
CREATE CONSTRAINT ON (node:`UNIQUE IMPORT LABEL`) ASSERT (node.`UNIQUE IMPORT ID`) IS UNIQUE; | |
:commit | |
CALL db.awaitIndexes(300); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ status: 'success', message: 'Book updated' } | |
{ | |
ISBN: 1, | |
publication: '2020-03-13', | |
createdAt: '2020-03-13T17:30:20.191000000Z' | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node { | |
diameter: 50px; | |
color: #A5ABB6; | |
border-color: #9AA1AC; | |
border-width: 2px; | |
text-color-internal: #FFFFFF; | |
font-size: 10px; | |
} | |
relationship { | |
color: #A5ABB6; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const neo4j = require('neo4j-driver').v1 | |
const driver = neo4j.driver('bolt://localhost:7687', neo4j.auth.basic('neo4j', 'neo')) | |
const session = driver.session() | |
session.run( | |
'CREATE (e:Event { id: $id, title: $title, startsAt: datetime($startsAt) }) RETURN e', | |
{ | |
id: 2, | |
title: 'Another Test Event', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create an express app | |
const express = require('express'); | |
const app = express(); | |
// Tell it to use Neo4j middleware | |
app.use(require('./neo4j')); | |
// Example Route | |
app.get('/', (req, res) => { | |
// Create Driver session |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>ANSIBlackColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS | |
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECUw | |
LjQ4OTQ2NTYxNjMgMC41NDM3OTkwNSAwLjU2MjMyMzI0NjYAEAKAAtIQERITWiRjbGFz | |
c25hbWVYJGNsYXNzZXNXTlNDb2xvcqISFFhOU09iamVjdF8QD05TS2V5ZWRBcmNoaXZl |
NewerOlder