Skip to content

Commit

Permalink
v2 added
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaxru committed May 1, 2018
1 parent 79867e9 commit a4e2d65
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 16 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<a name="2.0.0"></a>
## [2.0.0](https://github.com/angular/angular/compare/1.0.0...2.0.0) (2018-05-01)

### Code Refactoring

* **compiler:** Drop support for the deprecated `<template>`. Use `<ng-template>` instead ([#22783](https://github.com/angular/angular/issues/22783)) ([0ebd577](https://github.com/angular/angular/commit/0ebd577))


### Features

* **record:** Support for Node, Relationship, Path, Integer types of returned Record added ([79867e9c13becddd87b7e4d950138e2d60a61fbc](https://github.com/webmaxru/node-red-contrib-neo4j-bolt/commit/79867e9c13becddd87b7e4d950138e2d60a61fbc))


### BREAKING CHANGES

* **record:** Instead of returning just `properties` the full Record data returned now. To get the properties use `payload.properties` instead of just `payload`

<a name="1.0.0"></a>
## [1.0.0] (2018-04-30)
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Neo4j Bolt with shareable driver

A <a href="http://nodered.org" target="_new">Node-RED</a> node with the shareable server configuration that lets you run generic cypher queries on a Neo4j graph database.
A <a href="http://nodered.org" target="_new">Node-RED</a> node with the shareable server configuration that lets you run generic cypher queries on a Neo4j graph database and receive all types of Neo4j records.

## Install

Expand All @@ -12,9 +12,9 @@ npm install node-red-contrib-neo4j-bolt

## Usage

You specify a cypher query in the configuration. The parameters for the query (if needed) are read from `msg.params`. The cypher query can also be passed to the node as `msg.query`.
First, you define the Neo4j bolt URL and the basic authentication username and password in the configuration node. This node creates a driver which will be shared across all Neo4j-Bolt nodes. Each node creates its own driver session.

You define the Neo4j bolt URL and the basic authentication username and password in the configuration node which you can share across multiple neo4j-bolt nodes.
You can specify a cypher query in the node configuration or pass to the node as `msg.query`. The parameters for the query (if needed) are read from `msg.params`.

* Example of hard coded query in the configuration of the node.
```
Expand Down Expand Up @@ -46,7 +46,7 @@ msg.params:

The node has two outputs. If the query returns only 1 record, the requested properties of the node are sent to output #1. If the query returns multiple records, an array of requested properties of the nodes are sent to output #2.

This node uses the [neo4j-driver](https://www.npmjs.com/package/neo4j-driver) package to communicate with neo4j.
This node uses the [neo4j-driver](https://www.npmjs.com/package/neo4j-driver) package to communicate with Neo4j.

### Runtime information
This node was tested to Node.js v7.4.0 and NPM 5.6.0 on Node-Red v0.18.4
Expand Down
15 changes: 4 additions & 11 deletions neo4j.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
defaults: {
server: {value:"", type:"neo4j-bolt-server", required:true},
name: {value:""},
url: {value:""},
username: {value:""},
password: {value:""},
query: {value: ""}
},
inputs:1,
Expand All @@ -21,15 +18,15 @@

<script type="text/x-red" data-template-name="neo4j-bolt">
<div class="form-row">
<label for="node-input-server"><i class="icon-tag"></i> server</label>
<label for="node-input-server"><i class="icon-tag"></i> Server</label>
<input type="text" id="node-input-server" placeholder="server">
</div>
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i>Name</label>
<input type="text" id="node-input-name" placeholder="Name">
<br/>
<label for="node-input-query"><i class="icon-tag"></i>Cypher Query (opt)</label>
<textarea id="node-input-query" placeholder="MATCH (o:Object {attrib: 'value'}) RETURN o"></textarea>
<label for="node-input-query"><i class="icon-tag"></i>Cypher Query</label>
<textarea id="node-input-query" placeholder="MATCH (o:Object {attrib: 'value'}) RETURN o" style="width: 70%;"></textarea>
</div>
</script>

Expand All @@ -40,12 +37,8 @@
<p>A cypher query can be defined on the node or can be passed in <code>msg.query</code>. The query can be parameterized and the parameters can be passed in <code>msg.params</code> as JSON (string or object).</p>
<p>Outputs:
<ul>
<li><code>1:</code>If the query returns a single record, it is returned in output #1 as an object (with the Neo4j node properties) in <code>msg.payload</code></li>
<li><code>1:</code>If the query returns a single record, it is returned in output #1 as an object with the Neo4j Record (Node, Relationship, Path, Integer) fields in <code>msg.payload</code></li>
<li><code>2:</code>If the query returns a multiple records, they are returned in output #2 as an array of objects in <code>msg.payload</code></li>
</ul>
</p>

<p>
Supported by <a href="https://github.com/webmaxru/">Maxim Salnikov</a>. Based on <a href="https://github.com/nullibrew/node-red-contrib-nulli-neo4j">node-red-contrib-nulli-neo4j</a> by <a href="http://nulli.com">Nulli</a>
</p>
</script>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "1.0.0"
"version": "2.0.0"
}

0 comments on commit a4e2d65

Please sign in to comment.