ExistedGraph

ExistedGraph

Class to inherit. It must be used after adapting to the database.. Distorts graph logic so that the use of two-stage removal. It is a public, not a removed part of the graph.

Constructor

new ExistedGraph()

var ExistedGraph = factoryExistedGraph(Graph);

Source:

Methods

insert(link, callbackopt, contextopt) → {string}

Standard graph insert, but with locked removed field.

Parameters:
Name Type Attributes Description
link Link
callback ExistedGraph~insertCallback <optional>
context Object <optional>
Source:
Returns:

[id]

Type
string

on(event, callback)

Standard graph on method, but considering substitution the remove to the update.

Parameters:
Name Type Description
event string

name

callback ExistedGraphonCallback
Source:

query(selector) → {*}

Standard graph query, but visible only links where removed is undefined.

Parameters:
Name Type Description
selector string | LinkSelector
Source:
Returns:

query

Type
*

remove(selector, callbackopt, contextopt)

Instead of removing the changes remove field to true.

Parameters:
Name Type Attributes Description
selector string | LinkSelector
callback ExistedGraph~removeCallback <optional>
context Object <optional>
Source:

update(selector, modifier, callbackopt, contextopt) → {number}

Standard graph update, but with locked removed field in modifier, if context.removed is not true.

Parameters:
Name Type Attributes Description
selector string | LinkSelector
modifier LinkModifier
callback ExistedGraph~updateCallback <optional>
context Object <optional>
Source:
Returns:

[count]

Type
number

Type Definitions

insertCallback(erroropt, idopt)

Optional callback. If present, called with an error object as the first argument and, if no error, the unique id of inserted link as the second.

Parameters:
Name Type Attributes Description
error Error <optional>
id string <optional>
Source:

onCallback(oldLinkopt, newLinkopt, contextopt)

Parameters:
Name Type Attributes Description
oldLink Link <optional>

can be undefined on link and insert events

newLink Link <optional>

can be undefined on unlink and remove events

context Object <optional>

additional app information, such as context.userId

Source:

onCallback(oldLinkopt, newLinkopt, contextopt)

Parameters:
Name Type Attributes Description
oldLink Link <optional>

can be undefined on link and insert events

newLink Link <optional>

can be undefined on unlink and remove events

context Object <optional>

additional app information, such as context.userId

Source:

removeCallback(erroropt, countopt)

Optional callback. If present, called with an error object as the first argument.

Parameters:
Name Type Attributes Description
error Error <optional>
count number <optional>
Source:

updateCallback(erroropt, countopt)

Optional callback. If present, called with an error object as the first argument and, if no error, the number of affected documents as the second.

Parameters:
Name Type Attributes Description
error Error <optional>
count number <optional>
Source: