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
Using the deleteRelationships
static of a Model and providing a Where parameter, relationships of the Model can be deleted
1linkawait Users.deleteRelationships({
2link /* --> the Relationshhips to be deleted will be matched using this param */
3link where: {
4link /* --> (optional) the relationship(s) to be deleted need to be from a User with the name 'John' AND the id '1' */
5link source: {
6link name: 'John',
7link id: 1,
8link },
9link /* --> (optional) the relationship(s) to be deleted need to be to an Order with the id '2' */
10link target: {
11link id: 1,
12link },
13link /* --> (optional) the relationship(s) to be deleted need to be match the following properties */
14link relationship: {
15link rating: 5,
16link status: 'completed',
17link },
18link },
19link /* --> (optional) an existing session or transaction to use */
20link session: null,
21link});