-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce
Driver.executeQuery
(#1006)
This method gives the user a simple interface and obvious place to start with the driver. Behind this method the full retry mechanism will be present. The results are eagerly returned and in memory. With this, we have removed the need for the user to have knowledge of transactions, routing control, streaming of results and cursor lifetimes, and any of the more complex concepts that are exposed when using the session object. Running a simple write query: ```typescript const { keys, records, summary } = await driver.executeQuery( 'CREATE (p:Person{ name: $name }) RETURN p', { name: 'Person1'} ) ``` Running a read query: ```typescript const { keys, records, summary } = await driver.executeQuery( 'MATCH (p:Person{ name: $name }) RETURN p', { name: 'Person1'}, { routing: neo4j.routing.READERS} ) ``` Running a read query and transforming the result: ```typescript const person1 = await driver.executeQuery( 'MATCH (p:Person{ name: $name }) RETURN p', { name: 'Person1'}, { routing: neo4j.routing.READERS, resultTransformer: neo4j.resultTransformers.mappedResultTransformer({ map(record) { return record.get('p') }, collect(personArray) { return personArray[0] } }) } ) ```
- Loading branch information
Showing
28 changed files
with
2,188 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.