david on Nostr: The neo4j graph database query language, cypher, can add nodes one at a time using a ...
The neo4j graph database query language, cypher, can add nodes one at a time using a command like:
MERGE (n:NostrEvent {id:”abc123”})
But for a large number of nostr events, it’s much more performant to create a csv file, one row per event, and load them all at once with a command like:
LOAD CSV FROM 'file:////neo4jExport.csv' AS row MERGE (n:NostrEvent {id: row[0]})
In addition to the event id property, other properties can be included, e.g.:
pubkey: row[1], created_at: row[2], kind: row[3]
MERGE (n:NostrEvent {id:”abc123”})
But for a large number of nostr events, it’s much more performant to create a csv file, one row per event, and load them all at once with a command like:
LOAD CSV FROM 'file:////neo4jExport.csv' AS row MERGE (n:NostrEvent {id: row[0]})
In addition to the event id property, other properties can be included, e.g.:
pubkey: row[1], created_at: row[2], kind: row[3]