Skip to content

oskarhane/neo4j-javascript-driver

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neo4j Bolt Driver for JavaScript

The JavaScript driver for Bolt uses the websocket interface and is currently available for use within a browser context only. To use the driver, simply include the neo4j.js file within a page.

Example

// Create a Session object to contain all Cypher activity.
var session = new Session();

var statement = "MERGE (a:Person {name:'Alice'}) " +
                "MERGE (a)-[:KNOWS]->(b:Person {name:'Bob'}) " +
                "RETURN id(a), id(b)",
    parameters = {};

// Run a Cypher statement within an implicit transaction
session.run(statement, parameters,

    // Called on receipt of each RECORD
    function(record) {
        console.log("Values: " + record.join());
    },

    // Called on receipt of header summary message
    function(success, metadata) {
        if (success) {
            console.log("Fields: " + metadata["fields"].join());
        }
        else {
            console.log("FAILURE");
        }
        
    }

);

TODO

The JavaScript driver is still missing at least the following:

  • Integration with node.js
  • GraphDatabase and Driver classes from the Session API used by other drivers
  • Ability to specify the remote database URL (currently hard-coded to bolt:localhost)
  • A Transaction class

About

[ALPHA] JavaScript driver for Neo4j binary protocol

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 75.3%
  • HTML 24.7%