Overview Defining a Model Instances Creating Nodes and Relationships Merging Nodes and Relationships Updating Nodes and Relationships Deleting Nodes Deleting Relationships Finding Nodes and Relationships Hooks Temporary Databases
The QueryRunner
class can be used for arbitrary Cypher or Object-Graph mapping, without the need of defining Models. The parameters need to provide information about the labels etc. Bind parameters are used interally so there no need of escaping variables.
It also provides some utilities to help with running your queries.
To run queries, a QueryRunner
instance is needed.
1linkconst queryRunner = new QueryRunner({
2link /* --> a driver needs to be passed */
3link driver: neogma.driver,
4link /* --> (optional) logs every query that this QueryRunner instance runs, using the given function */
5link logger: console.log
6link /* --> (optional) Session config to be used when creating a session to run any query. If a custom session is passed to any method, this param will be ignored. */
7link sessionParams: {
8link database: 'myDb'
9link },
10link});