Skip to content

Commit feb0f77

Browse files
committed
add result consumption to run and executequery
1 parent 24ef510 commit feb0f77

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,15 @@ var executeQueryResultPromise = driver
307307
database: 'neo4j'
308308
}
309309
)
310+
311+
// returned Promise can be later consumed like this:
312+
executeQueryResultPromise
313+
.then(result => {
314+
console.log(result.records)
315+
})
316+
.catch(error => {
317+
console.log(error)
318+
})
310319
```
311320

312321
### Auto-Commit/Implicit Transaction
@@ -327,6 +336,16 @@ var implicitTxResultPromise = session
327336
database: 'neo4j'
328337
}
329338
)
339+
340+
// returned Promise can be later consumed like this:
341+
implicitTxResultPromise
342+
.then(result => {
343+
console.log(result.records)
344+
})
345+
.catch(error => {
346+
console.log(error)
347+
})
348+
.then(() => session.close())
330349
```
331350

332351
### Explicit Transactions

packages/neo4j-driver/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,15 @@ var executeQueryResultPromise = driver
307307
database: 'neo4j'
308308
}
309309
)
310+
311+
// returned Promise can be later consumed like this:
312+
executeQueryResultPromise
313+
.then(result => {
314+
console.log(result.records)
315+
})
316+
.catch(error => {
317+
console.log(error)
318+
})
310319
```
311320

312321
### Auto-Commit/Implicit Transaction
@@ -327,6 +336,16 @@ var implicitTxResultPromise = session
327336
database: 'neo4j'
328337
}
329338
)
339+
340+
// returned Promise can be later consumed like this:
341+
implicitTxResultPromise
342+
.then(result => {
343+
console.log(result.records)
344+
})
345+
.catch(error => {
346+
console.log(error)
347+
})
348+
.then(() => session.close())
330349
```
331350

332351
### Explicit Transactions

0 commit comments

Comments
 (0)