Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node Module for Neo4j

Tags:

node.js

neo4j

My app has Node JS. I'm trying to connect NodeJS and Neo4j together. Can some one tell me, how to connect both? My queries need to work with labels on Neo4j. Please let me know which module should I use in Node Js to achieve this?I have spent lot of time already with-out luck.

like image 599
Vineel Avatar asked Feb 19 '14 00:02

Vineel


People also ask

What are nodes used for in Neo4j?

Node. Nodes are used to represent entities (discrete objects) of a domain. The simplest possible graph is a single node with no relationships.

How many nodes are in Neo4j?

The limitation is currently 2^35, so approximately 34 billion nodes. See the documentation.


1 Answers

Last I checked there are at least 4 popular and actively developed node.js modules (ordered by number of stars):

  • https://github.com/thingdom/node-neo4j (npm install neo4j)
  • https://github.com/bretcope/neo4j-js (npm install neo4j-js)
  • https://github.com/philippkueng/node-neo4j (npm install node-neo4j)
  • https://github.com/brikteknologier/seraph (npm install seraph)

They all support the Cypher endpoint, which was a requirement for my inclusion. One key feature that stands out from the list is that philippkueng/node-neo4j is the only one that has transactional API support. Another is the ability to ask for labels of nodes, and that is supported only by seraph and philippkueng/node-neo4j. (usually you can avoid needing to ask for labels of a node if you make your Cypher query ask for labels explicitly, which avoids a request back and forth)

On the other hand, it's really not hard to just implement a few HTTP requests, directly accessing the Cypher or Transactional Cypher endpoints, massaging the results as you see fit for your application.

Another cool new development I've seen recently was https://github.com/brian-gates/cypher-stream, which emits a stream of results from Cypher, enabling streaming JSON parsing, which is another performance-oriented feature lacking from the four listed above.

Edit: 03/2016 There is a new official JS driver for use with the new bolt protocol (binary). For new development this should definitely be considered. Bolt is planned for release in Neo4j 3.0. https://github.com/neo4j/neo4j-javascript-driver

like image 52
Eve Freeman Avatar answered Sep 23 '22 15:09

Eve Freeman