File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,17 @@ driver.close();
68
68
// Create a driver instance, for the user neo4j with password neo4j.
69
69
var driver = neo4j .driver (" bolt://localhost" , neo4j .auth .basic (" neo4j" , " neo4j" ));
70
70
71
+ // Register a callback to know if driver creation was successful:
72
+ driver .onCompleted = function () {
73
+ // proceed with using the driver, it was successfully instantiated
74
+ };
75
+
76
+ // Register a callback to know if driver creation failed.
77
+ // This could happen due to wrong credentials or database unavailability:
78
+ driver .onError = function (error ) {
79
+ console .log (' Driver instantiation failed' , error);
80
+ };
81
+
71
82
// Create a session to run Cypher statements in.
72
83
// Note: Always make sure to close sessions when you are done using them!
73
84
var session = driver .session ();
You can’t perform that action at this time.
0 commit comments