I'm testing the neo4j-driver package to run Cypher queries via JavaScript/TypeScript.
I can run most queries just fine, but every time I try running the command MATCH (n) DETACH DELETE n
my program just keeps hanging and nothing happens.
My code:
// main.ts
import neo4j from "neo4j-driver"
const main = async () => {
const driver = neo4j.driver("bolt://localhost:7687",
neo4j.auth.basic("neo4j", "telmo"))
const session = driver.session()
console.log("This command works fine")
await session.run(`CREATE (n:Person {name: "Bob"}) RETURN n.name`)
console.log("This one does not")
await session.run("MATCH (n) DETACH DELETE n")
console.log("The code never even gets here")
session.close()
driver.close()
}
main()
Does anyone know why the program hangs on MATCH (n) DETACH DELETE n
and what can I do to fix it? Do notice that my database is only for testing and has a very small quantity of data.