forked from nullibrew/node-red-contrib-nulli-neo4j
/
neo4j.html
45 lines (42 loc) · 1.98 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
<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: ""}
},
inputs:1,
outputs:2,
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>
</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>
</ul>
</p>
</script>