create_relationship()

Usage

create_relationship(from, to, type)
create_relationship(from, to, type, key1, value1)
create_relationship(from, to, type, key1, value1, key2, value2, ...)

Structr.create_relationship(from, to, type, key1, value1, key2, value2);
Structr.create_relationship(from, to, type, {key1: value1, key2: value2});

Description
Creates a relationship of the given type between the two nodes. Please note that the inverse operation of this function is delete() since it can be used to delete both nodes and relationships. This method returns the created relationship.
In a JavaScript environment, the function can be used just as in a StructrScript environment. Alternatively it can take a dictionary as the fourth parameter.

Example

${create_relationship(me, group, 'HAS')}
About this article
Last change 2019-07-10
Topics FrontendFunctionsStructr 2.0