Star

Created With
You are viewing the documentation for Neogma v1. This version is in maintenance mode, and you can upgrade to v2 following the migration guide. For the latest features and improvements, see the Neogma v2 documentation.

linkCreating Nodes

A QueryRunner instance can be used for creating nodes from Objects. The node properties and label are needed.

1link/* --> let 'queryRunner' be a QueryRunner instance */

2linkconst result = await queryRunner.create({

3link /* --> label(s) of the created nodes. Multiple labels like 'User:Person' can also be used */

4link label: 'User',

5link /* --> data (properties) for the nodes. Here, 2 nodes will be created */

6link data: [

7link {

8link phoneNumber: '1234567890',

9link codes: [0, 3, 8],

10link },

11link {

12link age: 38,

13link }

14link ],

15link /* --> (optional) the identifier of the nodes for the query. Is needed for parsing the results. Default is the value of 'QueryRunner.identifiers.default' */

16link identifier: 'u',

17link /* --> (optional) an existing session or transaction to use */

18link session: null,

19link});

20link

21link/* --> the result is the QueryResult from the neo4j driver */

22linkconsole.log(result.records.map((v) => v.get('u').properties));

Creating Nodes

Introduction Getting Started

Modelschevron_right

Sessions and Transactions

Query Builderchevron_right
Query Runnerchevron_right

Bind Parameters

Where Parameters