1

I am a beginner in Neo4j I have tried using the code as suggested in this documentation: https://neo4j.com/developer/javascript/

But I am getting the following error:

Neo4jError: Unknown Bolt protocol version: 0

at captureStacktrace (C:\Users\abdsheikh\Documents\NodeJSApps\DrugRepo\node_modules\neo4j-driver\lib\result.js:275:15)
at new Result (C:\Users\abdsheikh\Documents\NodeJSApps\DrugRepo\node_modules\neo4j-driver\lib\result.js:66:19)
at Session._run (C:\Users\abdsheikh\Documents\NodeJSApps\DrugRepo\node_modules\neo4j-driver\lib\session.js:172:14)
at Session.run (C:\Users\abdsheikh\Documents\NodeJSApps\DrugRepo\node_modules\neo4j-driver\lib\session.js:133:19)
at Object.<anonymous> (C:\Users\abdsheikh\Documents\NodeJSApps\DrugRepo\neo4j.js:12:33)

Here is my code:

const neo4j = require('neo4j-driver')

uri = "bolt+s://<some-secret-url>.dbs.graphenedb.com:24787";
user = ""; //user was here
password = ""; // password was here

const driver = neo4j.driver(uri, neo4j.auth.basic(user, password))
const session = driver.session()

try {
  const resultPromise = session.run('match(c:Conditions) return c.Name');

  resultPromise.then(result => {
    session.close();
     console.log(node.properties);

    driver.close();
  }).catch((error) => {
    console.log(error);
  });

} finally {
  console.log("Bye");
}

2 Answers2

1

The error indicates that the bolt protocol might not be supported. Are you using the Neo4j version 3.5.x. I think that the new bolt+s protocol is enabled with the Neo4j 4.x series.

Try changing the uri to:

uri = "bolt://<some-secret-url>.dbs.graphenedb.com:24787";
Tomaž Bratanič
  • 6,319
  • 2
  • 18
  • 31
1

Ran into the same issue running Neo4j on Heroku using GrapheneDB and I actually had to downgrade neo4j-driver from 4.1.0 to 4.0.2 and use the bolt v1 protocol bolt:// as @Tomaž Bratanič mentioned.

GrapheneDB's documentation says they don't currently (June 15, 2020) support the 4.1.0 driver just yet.

You can also find more information on using the correct bolt versions here https://github.com/neo4j/neo4j-javascript-driver/issues/595.

devonj
  • 1,198
  • 1
  • 13
  • 24