Home Reference Source
import Relationship from 'neo-maggoo/lib/Relationship.js'
public class | source

Relationship

Extends:

Model → Relationship

Class representing a relationship between two Nodes

Static Member Summary

Static Public Members
public static get
public static get
public static get
public static get
public static set
public static get

Model: *

The related Node class or a function that returns a Node class

public static get
public static get

The direction of the relationship, can be Relationship.IN or Relationship.OUT

public static set
public static get

model: *

Alias for Model

public static set
public static set
public static get

If true a relationship will always have only a single related Node

public static set
public static get

type: *

The type of the relationship, will be used as the name of the relationship created in the graph

Constructor Summary

Public Constructor
public

constructor(relation: object | neo4j.types.Relationship, graph: Graph)

Creates an instance of Relationship

Member Summary

Public Members
public get
public get

Whether or not the Node has changed properties.

public

$entity: *

public

$graph: *

public get

The neo4j entity ID.

public get

Whether or not the node is already stored in the graph database.

public get

$type: *

public get

end: *

public set

end

public get

start: *

public set

Method Summary

Public Methods
public

async save(tx: any)

Save the relationship

public

setProperty(key: string, value: any)

Set property value

Static Public Members

public static get ANY: string source

public static get BOTH: string source

public static get DEFAULT_TYPE: string source

public static get IN: string source

public static set Model source

public static get Model: * source

The related Node class or a function that returns a Node class

public static get OUT: string source

public static get direction: * source

The direction of the relationship, can be Relationship.IN or Relationship.OUT

public static set direction source

public static get model: * source

Alias for Model

public static set model source

public static set singular source

public static get singular: * source

If true a relationship will always have only a single related Node

public static set type source

public static get type: * source

The type of the relationship, will be used as the name of the relationship created in the graph

Public Constructors

public constructor(relation: object | neo4j.types.Relationship, graph: Graph) source

Creates an instance of Relationship

Params:

NameTypeAttributeDescription
relation object | neo4j.types.Relationship

Relationship data object or neo4j Relationship

graph Graph

Current graph

Public Members

public get $direction: * source

public get $dirty: boolean source

Whether or not the Node has changed properties.

public $entity: * source

public $graph: * source

public get $id: number source

The neo4j entity ID. Note that this could change over time, use id instead.

public get $new: boolean source

Whether or not the node is already stored in the graph database.

public get $type: * source

public get end: * source

public set end source

public get start: * source

public set start source

Public Methods

public async save(tx: any) source

Save the relationship

Params:

NameTypeAttributeDescription
tx any
  • optional

Transaction

public setProperty(key: string, value: any) source

Set property value

Params:

NameTypeAttributeDescription
key string

Property name

value any

Property value