Neo4j Graph Data Model
Also works with new bolt driver
Changes
3.2.0 : allow setRelationship & set to be used with simple object and not just Model instance or id
breaking: v3 no longer relies on neo4j id's and sets own id
property if not set in model declaration
Usage
Setup
const NeoDM = ;NeoDMdb;NeoDMdb;
Model Declaration
const Joi = ;const Model = NeoDMModel;
Simple model declaration
static { return username: Joi ; } const johnData = username: 'john' ;const john = johnData; john;
hasOne relationship
static { return username: Joi ; } static { return title: Joi author: Model ; } const johnData = username: 'john' ;const john = johnData; john; const article = title: 'hello world' author: john ; article;
find( {property:value, anotherProp:value} )
static { return username: Joi ; } const johnData = username: 'john smith' ;const john = johnData; john; const johnFromDB = User;
find( [ id1, id2 ] )
const john = username: 'john' ; john; const smith = username: 'smith' ; smith; const users = User;
Full Model Declaration
static { return name:Joi } { //no return } { return Promise; } { return Promise; }
better see the tests
-signed gpg 3