Questions tagged [node-neo4j]

It uses Neo4j's REST API.

This library supports and has been tested against Neo4j 1.4 through Neo4j 1.8.

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.err('Error saving new node to database:', err);
    } else {
        console.log('Node saved to database with id:', node.id);
    }
});
53 questions
55
votes
2 answers

neo4j - labels vs properties vs relationship + node

Any rule of thumb on where to use label vs node property vs relationship + node. Let's have an example, say I have a store and I want to put my products in neo4j. Their identifier is the product sku, and I also want to have a categorization on them…
lorraine batol
  • 6,001
  • 16
  • 55
  • 114
28
votes
3 answers

Neo4j super node issue - fanning out pattern

I'm new to the Graph Database scene, looking into Neo4j and learning Cypher, we're trying to model a graph database, it's a fairly simple one, we got users, and we got movies, users can VIEW movies, RATE movies, create playlists and playlists can…
Eek
  • 1,740
  • 1
  • 15
  • 24
21
votes
1 answer

Are neo4j's cypher transactions broken?

TL;DR: I am either losing my mind, or neo4j's transactions are slightly broken. It looks like uncommitted nodes are available outside of committed transactions, with missing properties - or something equally weird. Our node.js app uses neo4j. A part…
Tasos Bitsios
  • 2,699
  • 1
  • 16
  • 22
5
votes
2 answers

Node-Neo4j: How to check if cypherquery to delete node succeeded?

I am using node-neo4j npm module, and using the db.cypherquery() call to call cypher queries from my node js application. I am trying to delete a relationship between two nodes, and I would like to detect if the delete succeeded or failed. Refer…
Gaurav Jain
  • 419
  • 4
  • 17
5
votes
0 answers

Neo4j Cypher: true boolean is recognized as string

In my application, to change the visibility of a node, I defined a is_full_show parameter which takes a true or false. I have an updateNodeEntity() function to change the other parameter values when needed. Following is part of my Cypher query in…
ylcnky
  • 775
  • 1
  • 10
  • 26
3
votes
1 answer

After query execution detect that merge created node, not matched

Simple question, that I'm having hard time googling. Using cypher via node-neo4j, I want to run some logic after query, but only if my MERGE created node (i.e ON CREATE inside query was triggered), not matched it. How can I achieve this?
Max Yari
  • 3,617
  • 5
  • 32
  • 56
2
votes
1 answer

Sails Neo4J Create relationship with sails-neo4J

I am pretty new to sailsJS and Neo4J, my roadblock is to create relation between two nodes with reference ID. My Code Sample : params.id = 'b8995544-02fc-4148-807f-d9c9f0ebd60f'; var q = [ 'MATCH (w:word{id:'+…
Ayyappa A
  • 657
  • 3
  • 8
  • 24
2
votes
2 answers

Cypher query not working from node.js but works from neo4j console

I am trying to write a node.js app that works with neo4j, using the node-neo4j module. I am trying to submit a query from nodejs and found it wasn't working, so I tried submitting it from the neo4j browser console, in order to more easily root cause…
Dude
  • 931
  • 6
  • 16
2
votes
1 answer

Why is Node-Neo4j not properly setting data?

Imagine a query like this: match (i:QuestionOrder) set i.count=i.count+1 merge (q:Question {text: '+text here+', index: i.count}) return q Neo4j guarantees write locks if sets occur within the same transaction which is implied by the same query…
Ben Reed
  • 824
  • 1
  • 8
  • 26
2
votes
1 answer

JS functional object constructor - Neo4j Database has no method 'query'

I'm using the node-neo4j library along with node.js, underscore and prototype. I'm trying to have a model which extends a database adapter. Code first. BaseModel.js: var _ = require("underscore"), Neo4jAdapter =…
Sebastian
  • 1,593
  • 4
  • 26
  • 41
2
votes
2 answers

NodeJs - Neo4j params issue on naming relationship

Im not able to use the params object to name a relationship between 2 nodes , Here is the code var neo4j = require('neo4j'); var db = new neo4j.GraphDatabase('http://localhost:7474'); var params = { name: { firstname: "SRI", …
Karthic Rao
  • 3,624
  • 8
  • 30
  • 44
2
votes
2 answers

Recommended way of getting single relationship of specific type between two nodes

Although title is clear, I need to remove a relationship between two nodes of a specific relationship type. Neither getSingleRelationship function of Node nor overloaded versions of getRelationships have second node parameter. Should I get all…
Gökhan Çoban
  • 600
  • 8
  • 17
2
votes
3 answers

Is node reference equality in embedded neo4j guaranteed?

I am using an embedded graph database as part of a java application. Suppose that I carry out some type of cypher query, and return an ExecutionResult which contains a collection of nodes. These nodes may be assumed to form a connected graph. Each…
phil_20686
  • 4,000
  • 21
  • 38
2
votes
1 answer

Neo4j and mysql data modelling

I am developing social networking website now a days. for that I am using MySql as my primary database and neo4j as in-memory database. I am using node.js and (for neo4j) too. Now I have a some doubt regarding data modelling for neo4j. I want to…
Manish Sapkal
  • 5,591
  • 8
  • 45
  • 74
1
vote
1 answer

getting error on simple read operation in node-neo4j

var express = require('express'); var app = express(); var neo4j = require('node-neo4j'); db = new neo4j('http://localhost:7474'); db.readNode(2, function (err, node) { if (err) throw err; console.log(node.data); …
chethan
  • 13
  • 3
1
2 3 4