Git Product home page Git Product logo

node-neo4j's Introduction

Build Status

Node-Neo4j

⚠️ NOTE: This library is no longer under development. Neo4j 3.0 comes with a first-party JavaScript driver which obviates the need for this library. ⚠️

This is a client library for accessing Neo4j, a graph database, from Node.js. It uses Neo4j's REST API, and supports Neo4j 1.5 through Neo4j 2.1.

(Note that new 2.0 features like labels and constraints are only accessible through Cypher for now -- but Cypher is the recommended interface for Neo4j anyway. This driver might change to wrap Cypher entirely.)

Update: node-neo4j v2 is under development and almost finished! Read the full spec here, and follow the progress in pull #145. If you're comfortable using pre-release code, alpha versions are available on npm; we at FiftyThree are running them in production. =)

Installation

npm install [email protected] --save

Usage

To start, create a new instance of the GraphDatabase class pointing to your Neo4j instance:

var neo4j = require('neo4j');
var db = new neo4j.GraphDatabase('http://localhost:7474');

Node.js is asynchronous, which means this library is too: most functions take callbacks and return immediately, with the callbacks being invoked when the corresponding HTTP requests and responses finish.

Here's a simple example:

var node = db.createNode({hello: 'world'});     // instantaneous, but...
node.save(function (err, node) {    // ...this is what actually persists.
    if (err) {
        console.error('Error saving new node to database:', err);
    } else {
        console.log('Node saved to database with id:', node.id);
    }
});

Because async flow in Node.js can be quite tricky to handle, we strongly recommend using a flow control tool or library to help. Our personal favorite is Streamline.js, but other popular choices are async, Step, Seq, TameJS and IcedCoffeeScript.

Once you've gotten the basics down, skim through the full API documentation to see what this library can do, and take a look at @aseemk's node-neo4j-template app for a complete usage example. (The models/User.js file in particular is the one that interacts with this library.)

This library is officially stable at "v1", but "v2" will almost certainly have breaking changes to support only Neo4j 2.0 and generally improve the API (roadmap). You can be sheltered from these changes if you simply specify your package.json dependency as e.g. 1.x or ^1.0 instead of *.

Development

git clone [email protected]:thingdom/node-neo4j.git
cd node-neo4j
npm install && npm run clean

You'll need a local installation of Neo4j (links), and it should be running on the default port of 7474 (neo4j start).

To run the tests:

npm test

This library is written in CoffeeScript, using Streamline.js syntax. The tests automatically compile the code on-the-fly, but you can also generate compiled .js files from the source ._coffee files manually:

npm run build

This is in fact what's run each time this library is published to npm. But please don't check the generated .js files in; to remove:

npm run clean

When compiled .js files exist, changes to the source ._coffee files will not be picked up automatically; you'll need to rebuild.

If you npm link this module into another app (like node-neo4j-template) and you want the code compiled on-the-fly during development, you can create an index.js file under lib/ with the following:

require('coffee-script/register');
require('streamline/register');
module.exports = require('./index._coffee');

But don't check this in! That would cause all clients to compile the code on-the-fly every time, which isn't desirable in production.

Changes

See the Changelog for the full history of changes and releases.

License

This library is licensed under the Apache License, Version 2.0.

Feedback

If you encounter any bugs or other issues, please file them in the issue tracker.

We also now have a Google Group! Post questions and participate in general discussions there.

node-neo4j's People

Contributors

aseemk avatar flipside avatar freeeve avatar gasi avatar jeremyis avatar jonpacker avatar pdehaan avatar sarpdoruk avatar sberryman avatar sergioharo avatar tasinet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-neo4j's Issues

Neo4j 1.6: support unique index "put if absent"

1.6 adds this:

o Exposes get-or-create-uniquely via REST in ex. POST /index/node/?unique {...}

We should consider adding support for specifying this in our library too. Low-pri for us because we prefer to use the auto-index, so we never manually index stuff currently.

dijkstra algorithm support

I'm looking into using neo4j's built in dijkstra algorithm, it looked like there's already some support in node-neo4j for shortest path but dijkstra support would be great.

How does node-neo4j handle Exceptions?

It appears from the CoffeeScript code that node-neo4j can throw Exceptions under certain conditions. Under other conditions, an error is returned in the callback. If so then it seems that I have to surround calls to node-neo4j with try/catch as well as handle any errors passed to me in my callback. Is this true?

UNCAUGHT EXCEPTION: Unexpected token ILLEGAL

UNCAUGHT EXCEPTION: Unexpected token ILLEGAL
SyntaxError: Unexpected token ILLEGAL
at Object.parse (native)
at Node_prototype_save__1 (/Users/foo/Temp/neo4j-enterprise-1.4.1/node_modules/neo4j/lib/Node_.coffee:54:78)
at Node_prototype_save__1 (undefined_.js:43:19)

I'm getting error message above when I try the example hello world you have in README. I'm running Node 0.4.11. I don't know coffeescript so when I tried to debug the code I couldn't do much :/

Leaking global i

var neo4j = require('neo4j')
  , db = new neo4j.GraphDatabase('http://localhost:7474')

db.getIndexedNodes('nodes', 'type', 'test', function(err, nodes) {
  console.log(i);
});
node test.js 
callback

outgoing support ordering

Is is possible to have the Node.outgoing() method to support passing in a sorting option?

I'm currently using a raw query to get an ordered relationship...

Concurrency issue?

Hello, I'm having trouble executing concurrent, (mutating?) requests. Below is a gist that should give you an idea of where the problem arises:

https://gist.github.com/3036561

Of course, this example is contrived, but in a webserver context (especially with node), it is not impossible to imagine such an event occurring naturally. I don't believe this is an issue with the node-neo4j library, but the error returned isn't very helpful so it's hard to tell... any info you have on this would be very much appreciated!

General traverse() method

[Title edited by @aseemk. Original title: "Node.getRelationshipNodes(): Don't hard-code maxDepth and add additional settings".]

Right now this method is hard-coded with maxDepth=1. This method would be a lot more useful if maxDepth could be passed in as a parameter. A few more options a la Neography's NodeTraverser would also be very helpful

Nesting objects in neo4j node properties

Hi, Is there a method for us to nest objects within properties of other nodes?
Otherwise is there an efficient way of converting a json with several nested objects, into many nodes and relationship ?

{
Name: bob,
School: SMU,

.
.
.
(Nested properties and objects)
}

javacript node.js websocket problem

hey, can you help me please ?. I'm running a websocket server named server.js
var ws = require(server + '../ws');

var server = ws.createServer();

but my Microsoft Javascript show me the following error
Error : "objet attendu"
Code : 800A138F

Can't get root node or node by id

I can't seem to get basic functionality working with this library. I was starting off getting a reference node to add new data too but something as trivial as that doesn't seem to work. I'm sure I'm just missing something basic but there's no error messages and nothing to go on.

var neo4j = require('neo4j');
var db = new neo4j.GraphDatabase('http://localhost:7474');

var node = db.getNodeById(0);
console.log(node.self);

Outputs

undefined

The neo4j service is up and running. The following GET works just fine from the command line:

GET http://localhost:7474/db/data/node/0

http proxy support

Hi

I now use neo4j outside of the firewall and use an http proxy to connect outsude.

Is there a built-in way to handle this? for now I have overriden this in util.js which works fine:

request = require("request").defaults({'proxy':'http://my-proxy:8080/'})

Thanks,
Yaron

Provide compiled files to reduce loading time.

Executing the following line takes more than 3 seconds to execute on my server. This is too slow to be acceptable.

var neo4j = require('neo4j');

This huge delay is caused by streamline. It reparses the whole library everytime you require neo4j.

How to fix:

cd node_modules/neo4j/lib
../node_modules/coffee-script/bin/coffee -c *.coffee
../node_modules/streamline/bin/node-streamline -c *.js
# Manually replace all require('blabla_') by require('blabla')

It would be really great if you could provide the compiled files in the NPM install :)

Thanks

Perf: stream JSON responses!

Neo4j apparently supports streaming JSON back instead of buffering it all up in memory first. This will probably improve perf considerably across the board for most apps.

Need to investigate: How does this work? Are there any downsides? Should this be a transparent change? Or should it require an API call/parameter?

getting path doesn't fetch nodes properties ?

hi !
i'm trying to get the nodes properties for the nodes contained in the array return by Node.path().
but path.nodes[i].data is always empty...
did i miss something ?
cheers,
guillaume

writes to neo4j on heroku, but can't retrieve possible followers

First off, thanks for the code!

Getting an issue on heroku where I'm able to enter and retrieve new users just fine but the webpage still responds that there's no possible followers.

"There's no one else left for (name) to follow!"

I've been poking around with this in users.js:

// GET /users/:id
exports.show = function (req, res, next) {
    User.get(req.params.id, function (err, user) {
        if (err) return next(err);
        // TODO also fetch and show followers?
        user.getFollowingAndOthers(function (err, following, others) {
            if (err) return next(err);
            res.render('user', {
                user: user,
                following: following,
                others: others
            });
        });
    });
};

and this in users.js

User.prototype.getFollowingAndOthers = function (callback) {
    // query all users and whether we follow each one or not:
    var query = [
        'START user=node({userId}), other=node:INDEX_NAME(INDEX_KEY="INDEX_VAL")',
        'MATCH (user) -[rel?:FOLLOWS_REL]-> (other)',
        'RETURN other'//, COUNT(rel)'  // COUNT(rel) is a hack for 1 or 0
    ].join('\n')
        .replace('INDEX_NAME', INDEX_NAME)
        .replace('INDEX_KEY', INDEX_KEY)
        .replace('INDEX_VAL', INDEX_VAL)
        .replace('FOLLOWS_REL', FOLLOWS_REL);

    var params = {
        userId: this.id,
    };

But can't figure out why it doesn't show other users as possible followers.

Is this the same code as is running in the web example? There's other data in my neo4j instance, could that possibly be messing with it?

Grateful for any help,

Thanks!

Edited to format the code! –@aseemk

Support/Request - Batch Operations

i could not find a way to get bulk or batch operations working with node-neo4j. i am looking on creating a dozen nodes and relating them to an existing node all in one query.

Any ideas?

connection problems to hosted db

Connecting to the local db works just fine but trying to connect to the hosted db provided through heroku keeps throwing HTTP 500 errors. My understanding is that it's an authentication issue.

var db = new neo4j.GraphDatabase(process.env.NEO4J_URL || 'http://localhost:7474');

Why does this work for the template app but not ours? Any suggestions?

Delete Node from Index is not possible.

Hello,

When deleting a node, the index is not cleared automatically. We found during our testing that Neo4J will not delete the node from the index and if we attempt to create (during testing) a node with the same ID, it'll give an error. While in testing it's not important, in production the index will continue to grow even if we delete nodes. so we might have 1 million node in the database but 2 million in the index (assuming we deleted a million of course).

Would it be possible to add 2 functions;
1- One to remove a node/relationship from Index.
2- Another to delete an index completely.

Any and All help would be much appreciated.

Regards.

Object Expected (on windows)

I'm running nodejs with neo4j in windows.

When i try to execute an app with the basic:

var neo4j = require('neo4j');

I get the error:

Object expected
Line: 2
Char : 1
Code: 800A138F

On Windows 7
[email protected]

errors on delete

Hi

I'm using neo4j 1.8 and node-neo4j.

I need to delete 100 relationships outgoing from node X to different nodes. When I do this synchronously there is no problem (e.g. I wait for one delete to finish before calling the next one).
When I delete them in an async manner (many rest requests sent concurrently) I intermittently get a few failures. Even when I limit the concurrent deletes to 3. I see this coming back in the http response once per each error:

HTTP/1.1 500 Transaction(15744)[STATUS_ACTIVE,Resources=1] can't wait on resource RWLock[Relationship[8253]] since => Transaction(15744)[STATUS_ACTIVE,Resources=1] <-[:HELD_BY]- RWLock[Node[1841]] <-[:WAITING_FOR]- Transaction(15744)[STATUS_ACTIVE,Resources=1] <-[:HELD_BY]- RWLock[Relationship[8253]]
Content-Length: 0
Server: Jetty(6.1.25)

I believe neo4j uses keep-alive to reuse the same connection but this does not seem relevant. I have verified my code is (logically) correct, e.g. I do not delete an already deleted link and etc. Also I delete using "relationship.del _, true".

Any idea?

Thanks,
Yaron

Callback passed to Node.save() does not receive any data

The documentation implies that the callback passed to Node.save() receives an error argument and a results argument. However, no arguments are sent on a successful request. Even though the Node instance itself is updated on a successful request, it might be helpful to pass that Node to the callback in the results argument. Failing that, the documentation should be updated to make it clear what the behavior is. I spun my wheels for a while thinking that my Node.save() calls were failing because the request argument was 'undefined.'

Tests Failing with Neo4j 1.8.1

Server url
http://localhost:7474
Kernel version
Neo4j - Graph Database Kernel 1.8.1

[email protected] test /home/paul/workspace/helpdeskgenius/node_modules/neo4j

_coffee test

passed CRUD tests

/home/paul/workspace/helpdeskgenius/node_modules/neo4j/node_modules/streamline/lib/callbacks/runtime.js:134
throw err;
^
AssertionError: "user8" == "user7"
at ___ (/home/paul/workspace/helpdeskgenius/node_modules/neo4j/test/cypher._coffee:196:4338)
at ___ (/home/paul/workspace/helpdeskgenius/node_modules/neo4j/node_modules/streamline/lib/callbacks/runtime.js:85:13)
at GraphDatabase_prototype_query__13 (/home/paul/workspace/helpdeskgenius/node_modules/neo4j/lib/GraphDatabase.js:241:56)
at main (/home/paul/workspace/helpdeskgenius/node_modules/neo4j/test/cypher._coffee:119:12)

npm ERR! Test failed. See above for more details.
npm ERR! not ok code 0

createRelationship metod

Hi, I like node-neo4j very much.

I need to implement someting like this
" ... relation = db.createRelationship(currentNodeId, id, "VSEBUJE", saveRelation) ..."

but in source code is stated:

"...
# Relationships
createRelationship: (startNode, endNode, type, _) ->
# TODO: Implement
..."

Can you give me some advise how can I implement this metod.

Thank you , Jadran

Support 1.8

With the latest Neo4j server from brew I get this:

Error: [object Object]
    at exports.adjustError (node_modules/neo4j/lib/util.js:67:15)
    at __$GraphDatabase_prototype_query__14 (node_modules/neo4j/lib/GraphDatabase.js:276:26)
    at __tryCatch (node_modules/neo4j/node_modules/streamline/lib/callbacks/runtime.js:141:4)
    at ___ (node_modules/neo4j/lib/GraphDatabase.js:274:118)
    at ___ (node_modules/neo4j/lib/GraphDatabase.js:255:28)
    at Request.___ [as _callback] (node_modules/neo4j/node_modules/streamline/lib/callbacks/runtime.js:85:13)
    at Request.init.self.callback (node_modules/request/main.js:120:22)
    at Request.EventEmitter.emit (events.js:96:17)
    at Request.<anonymous> (node_modules/request/main.js:555:16)
    at Request.EventEmitter.emit (events.js:93:17)

I don't know what provoked it, sorry.

TypeError: Cannot read property 'url' of undefined at exports.wrapRequest.modifyArgs

I cannot get the simple example code working since the code fails with exception:

TypeError: Cannot read property 'url' of undefined
    at exports.wrapRequest.modifyArgs (/home/jhh/git/nko3/oulu/api/node_modules/neo4j/lib/util.js:27:17)
    at Object.exports.wrapRequest.wrapper.(anonymous function) [as get] (/home/jhh/git/nko3/oulu/api/node_modules/neo4j/lib/util.js:46:37)
    at ___ (/home/jhh/git/nko3/oulu/api/node_modules/neo4j/lib/GraphDatabase.js:59:40)
    at ___ (/home/jhh/git/nko3/oulu/api/node_modules/neo4j/node_modules/streamline/lib/callbacks/runtime.js:85:13)
    at GraphDatabase_prototype__getRoot__1 (/home/jhh/git/nko3/oulu/api/node_modules/neo4j/lib/GraphDatabase.js:48:56)
    at GraphDatabase_prototype_getServices__2 (/home/jhh/git/nko3/oulu/api/node_modules/neo4j/lib/GraphDatabase.js:59:19)

My test code is like this:

var GraphDatabase = require('neo4j').GraphDatabase;
var _db = new GraphDatabase('http://foo:[email protected]:7526/db/data/');
// ...
    var n = _db.createNode(req.params);
    n.save(function (err, n) {
        if (err) {
            return next('Error saving new node to database');
        } else {
            res.send(201, {'node':n});
            return next();
        }
    });

What am I doing wrong? Or is this a bug?

Support specifying max execution time?

From Neo4j 1.6's changelog:

o Added request timeout, controlled with org.neo4j.server.webserver.limit.executiontime (disabled by default). Request header (max-execution-time) can shorten it if specified.

Might be nice to add support into our library to specify this on a request basis. We probably won't make use of it yet though, so chime in if you think you might. (And pull requests always welcome. =D)

install on Heroku fails

Hi All,

I am using the node-neo4j package on a project that I am hosting on Heroku. Upon pushing the project, it fails on the post-install step of node-neo4j. However, the package installs just fine on my local machine, so I am not sure if there is an actual issue here. Alternatively, I am thinking that there could be an issue with the buildpack, or with the specific versions of Node.js (v0.8.2) and NPM (v1.1.39) I am using on Heroku.

I will continue to investigate the problem, but if anyone has seen this before, or knows what might be going on, that would be most helpful.

Please find the Heroku output below.

Best,
-Eric

> [email protected] postinstall /tmp/build_20zj9urr4tkew/node_modules/neo4j
> npm run build

sh: npm: not found
npm http GET https://registry.npmjs.org/crc/0.2.0
npm http GET https://registry.npmjs.org/mime/1.2.6
npm ERR! [email protected] postinstall: `npm run build`
npm ERR! `sh "-c" "npm run build"` failed with 127
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the neo4j package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run build
npm ERR! You can get their info via:
npm ERR!     npm owner ls neo4j
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 2.6.32-343-ec2
npm ERR! command "/tmp/node-node-oFAf/bin/node" "/tmp/node-npm-vcxz/cli.js" "install" "--production"
npm ERR! cwd /tmp/build_20zj9urr4tkew
npm ERR! node -v v0.8.2
npm ERR! npm -v 1.1.39
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] postinstall: `npm run build`
npm ERR! message `sh "-c" "npm run build"` failed with 127

param support for queries

any chance of expanding the query functionality to include params?

db.query(query, params, callback)

The API supports this:
{"query": "start x = node(23) match x -[r]-> n return type(r), n.name?, n.age?","params": {}}

Add EventEmitter/streaming support in the API

The new neo4j streaming support provides some performance enhancements. However, clients of the node-neo4j API still have to wait for the entire result set to be collected, possibly converted to Node or Relationship objects, and then finally returned.

With neo4j streaming, a streaming JSON API such as Clarinet (https://github.com/dscape/clarinet), and an EventEmitter-based implementation, node-neo4j could return each result in a result set as it is received in something like a stream.on('result', obj) API.

This would obviously be a big win especially for large result sets.

Index Relationships

I want to be able to create indexes for relationships same as for nodes.

Just started looking into how it was done for nodes and I'm trying to figure out how if services.node_index just becomes services.relationship_index?

Will experiment tomorrow.

Add node to multiple indexes

Hi,

Is there a way to add a node to multiple indexes in one go? At the moment i'm still doing this... which isnt really adding multiple indexs at one time

node.save(function (err) {
    if (err) return callback(err);
    node.index("users", "username", data.username, function (err) {
        if (err) return callback(err);
        node.index("node", "type", "user", function (err) {
            if (err) return callback(err);
            callback(null, user);
        }); 
    });       
});

Whats the proper way to do it ? thanks.

Automated indexing

getIndexedNodes() method doesnt seem to work with automated indexing. Any idea on how this can be accomplished?

Create a path

I'm really confused with this lib.

Maybe is due of the lack of doc..

I was checking the codes and i don't come with the answer.

I have 3 nodes

node1, node2, node3

And 2 relationships
node1->node2
node2->node3

I want to get the best path from node1 to node3

But i don't know how to create a path and how to use it....

Any help?

I see a lot of nice methods in neo4j for finding best paths but seems to don't be implemented here?

My actual code can be reviewed in https://github.com/naxhh/playground/blob/master/neo4j/app.js

connection best practices

I'm using neo4j from an express app. What's the best practice for create vs. reuse connections? I've noticed that a new connection always sends some handshake request to the server. So often creation is not good. But is it ok to reuse one connection object throughout the whole app sessions?

Neo4j 1.6: support specifying Cypher version?

From the changelog:

o Queries can now be pre-pended with which parser version to use

This seems like it might be useful, in case future Neo4j versions introduce breaking changes (which is likely). I don't see how to specify this in the REST API though. Need to investigate, but low-pri for us.

When i create relationships i get new properties

Well, here i'm again.

Maybe you gona hate me so much this week ^^

Thats a strange thing and i think it's not a node-neo4j issue, just my issue... but i don't get the point and i don't know where else to ask.

I'm trying to make a more dynamic whay to create,delete nodes and add relations to the system so i do this:
https://github.com/naxhh/playground/blob/master/neo4j/app.js

The problem is, when i create a new relationship i get 3 or 4 new properties

And i don't know why.

When i use the browser cms and i create a relationship it adds a relationship as normal

HTTP Basic Auth

Hi guys, I using your library on heroku and have spotted authentication issue. Requests to the remote neo4h server authenticated using basic http authentication, but server response doesn't contain auth part in urls, so, all requests other then _getRoot becomes unauthorized. I've solved it using monkey-patching request library, but, maybe you can fix it better in future releases. Here is my solution:

at the beginning of lib/GraphDatabase_.coffee

status = require 'http-status'
request = require 'request'

applyPatch = (method, auth) ->
    return if applyPatch.patched[method]
    applyPatch.patched[method] = true
    __m = request[method]
    request[method] = ->
        args = [].slice.call(arguments)
        url = args[0]
        console.log(args)
        if url && url.match && !url.match(/https?:\/\/[^\/]*@/)
            args[0] = url.replace(/http:\/\//, 'http://' + auth + '@')
        if url && url.url && url.url.match && !url.url.match(/https?:\/\/[^\/]*@/)
            args[0].url = url.url.replace(/http:\/\//, 'http://' + auth + '@')
        __m.apply(request, args)

applyPatch.patched = {}

util = require './util_'
adjustError = util.adjustError

Relationship = require './Relationship_'
Node = require './Node_'

module.exports = class GraphDatabase
    constructor: (url) ->

        @url = url
        @auth = require('url').parse(url).auth

        applyPatch('get', @auth)
        applyPatch('post', @auth)

I know, this is a quick and dirty solution, just wanted to demonstrate what happens.

npm test failes with Neo4J 1.5 and latest from github

Hi,
I tried exactly the steps from "Development" section from Readme. When i start the tests it fails:

neo4j-node/neo4j$ npm test

> [email protected] test /home/thomas/Projekte/Laboratory/neo4j-node/neo4j
> node test

UNCAUGHT EXCEPTION: The syntax for bound nodes has changed in v1.5 of Neo4j. Now, it is START a=node(<nodeId>), or START a=node:idxName(key='value').
"start n=(21) return n"
         ^
Error: The syntax for bound nodes has changed in v1.5 of Neo4j. Now, it is START a=node(<nodeId>), or START a=node:idxName(key='value').
"start n=(21) return n"
         ^
    at /home/thomas/Projekte/Laboratory/neo4j-node/neo4j/lib/util_.coffee:14:10
    at GraphDatabase_prototype_query__10 (/home/thomas/Projekte/Laboratory/neo4j-node/neo4j/lib/GraphDatabase_.coffee:180:11)
    at main (/home/thomas/Projekte/Laboratory/neo4j-node/neo4j/test/cypher_.coffee_.js:65:10)

UNCAUGHT EXCEPTION: 405
Error: 405
    at ___ (/home/thomas/Projekte/Laboratory/neo4j-node/neo4j/lib/Node_.coffee:272:11)
    at Request.___ [as callback] (/home/thomas/Projekte/Laboratory/neo4j-node/neo4j/lib/Node_.coffee:1:887)
    at Request.<anonymous> (/home/thomas/Projekte/Laboratory/neo4j-node/neo4j/node_modules/request/main.js:314:21)
    at Request.emit (events.js:67:17)
    at IncomingMessage.<anonymous> (/home/thomas/Projekte/Laboratory/neo4j-node/neo4j/node_modules/request/main.js:295:19)
    at IncomingMessage.emit (events.js:88:20)
    at HTTPParser.onMessageComplete (http.js:137:23)
    at Socket.ondata (http.js:1125:24)
    at TCP.onread (net.js:334:27)
    at main (/home/thomas/Projekte/Laboratory/neo4j-node/neo4j/test/crud_.coffee_.js:124:0)

It seems that it doesn't work with the latest Neo4J 1.5?

getNodeById synchronization problem

Hi I am considering to use node-neo4j for a project however during my test i faced a problem.
When I execute the code below

var node1 = db.getNodeById(1, print1);
console.log("node : " + node1);        

what i see is node1 is undefined. I have added logs into GraphDatabase getNodeById and I
figured that getNodeById returns before getting data from the server. I am not very familiar with
asychronuous functions in javascript but i believe this is the case here.

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.