Git Product home page Git Product logo

neo4js's Introduction

Neo4j server client for JavaScript

The beginnings of a neo4j server client for client-side javascript.

Quick example

Neo4js makes heavy use of promises (also known as futures), methods that make calls to the database usually return a promise for a result of some kind.

For instance:

var nodePromise = graph.node("http://localhost:75");
nodePromise.then(function(node) {
    // Do something with the node.
});

// Or just
graph.node(0).

Example usage:

var graph = new neo4j.GraphDatabase("http://localhost:7474");

var lisaPromise = graph.node({ "name" : "Lisa" });
var bobPromise = graph.node({ "name" : "Bob" });

var lovePromise = graph.rel(lisaPromise, "LOVES", bobPromise, { "reason" : "All the bling he got." });

// Wait for the promise of a relationship to be fulfilled.
lovePromise.then(function(relationship) {

  // Get the end node of the LOVES relationship
  relationship.getEndNode().then(function(bob) {

    // Once you have a node or relationship object, all properties are immediately available:
    var name = bob.getProperty("name");

    // Change a property like this
    bob.setProperty("name", "Steven");
    bob.save().then(function(steven) {
      // Bob is now saved.
    });

  });

});

Build production version

git clone http://github.com/neo4j/neo4js.git
cd neo4js
mvn package

This will create target/classes/neo4js.js

To use, check out the API documentation for neo4j.GraphDatabase. Note that neo4js.js requires jQuery to run.

API Documentation

mvn site

Documentation is then found in target/site/jsdocs

neo4js's People

Contributors

cybear avatar jakewins avatar nawroth avatar neilk avatar simpsonjulian avatar systay avatar tbaum avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.