Skip to content

Commit f05d938

Browse files
authored
Merge pull request #508 from martin-neotech/4.0-update-examples
Updated the old example
2 parents 0e7ed77 + 2383166 commit f05d938

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

examples/neo4j.html

+11-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8" />
5-
<title>Cypher Runner for Neo4j Bolt Protocol</title>
5+
<title>example</title>
66
<style>
77
#main {
88
width: 60%;
@@ -97,8 +97,12 @@
9797
</head>
9898
<body>
9999
<div id="main">
100-
<h1>Cypher Runner for New Remoting</h1>
101-
100+
<h1>
101+
<a href="https://github.com/neo4j/neo4j-javascript-driver"
102+
>neo4j-javascript-driver</a
103+
>
104+
example
105+
</h1>
102106
<table width="100%" border="0" cellspacing="0" cellpadding="0">
103107
<tr>
104108
<td id="console">
@@ -161,7 +165,7 @@ <h1>Cypher Runner for New Remoting</h1>
161165
</div>
162166

163167
<script>
164-
var authToken = neo4j.auth.basic('neo4j', 'neo4j')
168+
var authToken = neo4j.auth.basic('neo4j', 'password')
165169
console.log(authToken)
166170
var driver = neo4j.driver('bolt://localhost', authToken, {
167171
encrypted: false
@@ -260,15 +264,14 @@ <h1>Cypher Runner for New Remoting</h1>
260264
document.getElementById('runButton').onclick = run
261265

262266
if (document.location.href.indexOf('example') >= 0) {
263-
// document.getElementById("statement").textContent = "MERGE (alice:Person {name:{name_a},age:{age_a},married:{married_a}})\nMERGE (bob:Person {name:{name_b},age:{age_b},married:{married_b}})\nCREATE UNIQUE (alice)-[alice_knows_bob:KNOWS]->(bob)\nRETURN alice, bob, alice_knows_bob";
264267
document.getElementById('statement').textContent =
265-
'MERGE (alice:Person {name:{name_a},age:{age_a}})\nMERGE (bob:Person {name:{name_b},age:{age_b}})\nCREATE UNIQUE (alice)-[alice_knows_bob:KNOWS]->(bob)\nRETURN alice, bob, alice_knows_bob'
268+
'MERGE (alice:Person {name: $name_a, age: $age_a})\nMERGE (bob:Person {name: $name_b, age: $age_b})\nCREATE UNIQUE (alice)-[alice_knows_bob:KNOWS]->(bob)\nRETURN alice, bob, alice_knows_bob'
269+
266270
addParameter('name_a', 'Alice')
267271
addParameter('age_a', 33)
268-
//addParameter("married_a", "true");
272+
269273
addParameter('name_b', 'Bob')
270274
addParameter('age_b', 44)
271-
//addParameter("married_b", "false");
272275
}
273276
</script>
274277
</body>

0 commit comments

Comments
 (0)