forked from nullibrew/node-red-contrib-nulli-neo4j
-
Notifications
You must be signed in to change notification settings - Fork 4
/
neo4j.html
55 lines (52 loc) · 2.64 KB
/
neo4j.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<script type="text/javascript">
RED.nodes.registerType('neo4j-bolt',{
category: 'Neo4j',
color: '#97ddf4',
defaults: {
server: {value:"", type:"neo4j-bolt-server", required:true},
name: {value:""},
query: {value: ""},
sessions: {value: 10, required: true},
database: {value: ""}
},
inputs:1,
outputs:3,
outputLabels: ["single", "array", "no session available - retry later"],
icon: "neo4j.png",
label: function() {
return this.name||"neo4j-bolt";
}
});
</script>
<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>
<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</label>
<textarea id="node-input-query" placeholder="MATCH (o:Object {attrib: 'value'}) RETURN o" style="width: 70%;"></textarea>
<br/>
<label for="node-input-sessions"><i class="icon-tag"></i>Concurrent sessions</label>
<input type="text" id="node-input-sessions" placeholder="10" />
<br />
<label for="node-input-database"><i class="icon-tag"></i> Database</label>
<input type="text" id="node-input-database" placeholder="database">
</div>
</script>
<script type="text/x-red" data-help-name="neo4j-bolt">
<p>A Neo4j cypher query node</p>
<p>Neo4J cypher node that lets you run generic cypher queries on a Neo4j graph database.</p>
<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>The database name to use may be passed in <code>msg.database</code>.</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 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>
<li><code>2:</code>If there are no available sessions, the msg is passed untouched for the calling flow to decide on what to do, e.g. retry</li>
</ul>
</p>
</script>