Skip to content

Commit a9965f5

Browse files
author
Petra Selmer
committed
Addressed Oskar's comments
1 parent 31c525c commit a9965f5

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

test/v1/examples.test.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ describe('examples', function() {
6262
var driver = neo4j.driver("bolt://localhost", neo4j.auth.basic("neo4j", "neo4j"));
6363
var session = driver.session();
6464
session
65-
.run( "CREATE (a:Person {name: {name}, title: {title}})", {"name": "Arthur", "title": "King"})
65+
.run( "CREATE (a:Person {name: {name}, title: {title}})", {name: "Arthur", title: "King"})
6666
.then( function()
6767
{
6868
return session.run( "MATCH (a:Person) WHERE a.name = {name} RETURN a.name AS name, a.title AS title",
69-
{"name": "Arthur"})
69+
{name: "Arthur"})
7070
})
7171
.then( function( result ) {
7272
console.log( result.records[0].get("title") + " " + result.records[0].get("name") );
@@ -87,7 +87,7 @@ describe('examples', function() {
8787
//end::configuration[]
8888

8989
var s = driver.session();
90-
s.run( "CREATE (p:Person {name: {name}})", {"name": "The One"} )
90+
s.run( "CREATE (p:Person {name: {name}})", {name: "The One"} )
9191
.then( function(result) {
9292
var theOnesCreated = result.summary.counters.nodesCreated();
9393
console.log(theOnesCreated);
@@ -104,7 +104,7 @@ describe('examples', function() {
104104
var session = sessionGlobal;
105105
// tag::statement[]
106106
session
107-
.run( "CREATE (person:Person {name: {name}})", {"name": "Arthur"} )
107+
.run( "CREATE (person:Person {name: {name}})", {name: "Arthur"} )
108108
// end::statement[]
109109
.then( function(result) {
110110
var theOnesCreated = result.summary.counters.nodesCreated();
@@ -137,12 +137,12 @@ describe('examples', function() {
137137
it('should be able to iterate results', function(done) {
138138
var session = sessionGlobal;
139139
session
140-
.run( "CREATE (weapon:Weapon {name: {name}})", {"name": "Sword in the stone"} )
140+
.run( "CREATE (weapon:Weapon {name: {name}})", {name: "Sword in the stone"} )
141141
.then(function() {
142142
// tag::result-traversal[]
143143
var searchTerm = "Sword";
144144
session
145-
.run( "MATCH (weapon:Weapon) WHERE weapon.name CONTAINS {term} RETURN weapon.name", {"term": searchTerm} )
145+
.run( "MATCH (weapon:Weapon) WHERE weapon.name CONTAINS {term} RETURN weapon.name", {term: searchTerm} )
146146
.subscribe({
147147
onNext: function(record) {
148148
console.log("" + record.get("weapon.name"));
@@ -167,13 +167,13 @@ describe('examples', function() {
167167
var session = sessionGlobal;
168168
session
169169
.run( "CREATE (weapon:Weapon {name: {name}, owner: {owner}, material: {material}, size: {size}})",
170-
{"name": "Sword in the stone", "owner": "Arthur", "material": "Stone", "size": "Huge"})
170+
{name: "Sword in the stone", owner: "Arthur", material: "Stone", size: "Huge"})
171171
.then(function() {
172172
// tag::access-record[]
173173
var searchTerm = "Arthur";
174174
session
175175
.run( "MATCH (weapon:Weapon) WHERE weapon.owner CONTAINS {term} RETURN weapon.name, weapon.material, weapon.size",
176-
{"term": searchTerm} )
176+
{term: searchTerm} )
177177
.subscribe({
178178
onNext: function(record) {
179179
var sword = [];
@@ -204,12 +204,12 @@ describe('examples', function() {
204204
var session = sessionGlobal;
205205

206206
session
207-
.run("CREATE (knight:Person:Knight {name: {name}, castle: {castle}})", {"name": "Lancelot", "castle": "Camelot"})
207+
.run("CREATE (knight:Person:Knight {name: {name}, castle: {castle}})", {name: "Lancelot", castle: "Camelot"})
208208
.then(function() {
209209
// tag::retain-result[]
210210
session
211211
.run("MATCH (knight:Person:Knight) WHERE knight.castle = {castle} RETURN knight.name AS name",
212-
{"castle": "Camelot"})
212+
{castle: "Camelot"})
213213
.then(function (result) {
214214
var records = [];
215215
for (i = 0; i < result.records.length; i++) {
@@ -238,17 +238,17 @@ describe('examples', function() {
238238
session
239239
.run( "CREATE (knight:Person:Knight {name: {name1}, castle: {castle}})" +
240240
"CREATE (king:Person {name: {name2}, title: {title}})",
241-
{"name1": "Lancelot", "castle": "Camelot", "name2": "Arthur", "title": "King"})
241+
{name1: "Lancelot", castle: "Camelot", name2: "Arthur", title: "King"})
242242
.then(function() {
243243
// tag::nested-statements[]
244244
session
245245
.run("MATCH (knight:Person:Knight) WHERE knight.castle = {castle} RETURN id(knight) AS knight_id",
246-
{"castle": "Camelot"})
246+
{castle: "Camelot"})
247247
.subscribe({
248248
onNext: function(record) {
249249
session
250250
.run("MATCH (knight) WHERE id(knight) = {id} MATCH (king:Person) WHERE king.name = {king} CREATE (knight)-[:DEFENDS]->(king)",
251-
{"id": record.get("knight_id"), "king": "Arthur"});
251+
{id: record.get("knight_id"), king: "Arthur"});
252252
},
253253
onCompleted: function() {
254254
session
@@ -287,10 +287,10 @@ describe('examples', function() {
287287
it('should be able to profile', function(done) {
288288
var session = sessionGlobal;
289289

290-
session.run("CREATE (:Person {name: {name}})", {"name": "Arthur"}).then(function() {
290+
session.run("CREATE (:Person {name: {name}})", {name: "Arthur"}).then(function() {
291291
// tag::result-summary-query-profile[]
292292
session
293-
.run("PROFILE MATCH (p:Person {name: {name}}) RETURN id(p)", {"name": "Arthur"})
293+
.run("PROFILE MATCH (p:Person {name: {name}}) RETURN id(p)", {name: "Arthur"})
294294
.then(function (result) {
295295
console.log(result.summary.profile);
296296
});
@@ -329,7 +329,7 @@ describe('examples', function() {
329329

330330
// tag::transaction-commit[]
331331
var tx = session.beginTransaction();
332-
tx.run( "CREATE (:Person {name: {name}})", {"name": "Guinevere"} );
332+
tx.run( "CREATE (:Person {name: {name}})", {name: "Guinevere"} );
333333
tx.commit();
334334
// end::transaction-commit[]
335335
});
@@ -339,7 +339,7 @@ describe('examples', function() {
339339

340340
// tag::transaction-rollback[]
341341
var tx = session.beginTransaction();
342-
tx.run( "CREATE (:Person {name: {name}})", {"name": "Merlin"});
342+
tx.run( "CREATE (:Person {name: {name}})", {name: "Merlin"});
343343
tx.rollback();
344344
// end::transaction-rollback[]
345345
});

0 commit comments

Comments
 (0)