Class: OGMRelation

OGMRelation()

new OGMRelation()

Source:

Methods

(static) count(query) → {Promise.<(integer|Error)>}

Count relation nodes.
Parameters:
Name Type Description
query OGMNeoRelationQuery Query filter.
Source:
Returns:
Count of relations if fulfilled, or some neo4j error if rejected.
Type
Promise.<(integer|Error)>

(static) countOperation(query) → {OGMNeoOperation}

Operation that counts relation nodes.
Parameters:
Name Type Description
query OGMNeoRelationQuery Query filter.
Source:
Throws:
Will throw an error if the query object was null or not an instance of ogmneo.RelationQuery.
Type
Error
Returns:
Operation that count nodes with query.
Type
OGMNeoOperation

(static) deleteMany(query) → {Promise.<(array|Error)>}

Deletes all relation nodes that matches parameters query.
Parameters:
Name Type Description
query OGMNeoRelationQuery Query filter.
Source:
Returns:
Deleted nodes if fulfilled, or some neo4j error if rejected.
Type
Promise.<(array|Error)>

(static) deleteManyOperation(query) → {OGMNeoOperation}

Operation that deletes all relation nodes that matches parameters query.
Parameters:
Name Type Description
query OGMNeoRelationQuery Query filter.
Source:
Throws:
Will throw an error if the query object was null or not an instance of ogmneo.RelationQuery.
Type
Error
Returns:
Operation that deletes nodes with query.
Type
OGMNeoOperation

(static) deleteRelation(relationId) → {Promise.<(boolean|Error)>}

Delete relation by id.
Parameters:
Name Type Description
relationId integer relation node id.
Source:
Returns:
Deleted relation node if fulfilled, or some neo4j error if rejected.
Type
Promise.<(boolean|Error)>

(static) deleteRelationOperation(relationId) → {OGMNeoOperation}

Operation that deletes a relation by id.
Parameters:
Name Type Description
relationId integer relation node id.
Source:
Throws:
Will throw an error if the relation id was not an integer value.
Type
Error
Returns:
Operation that deletes a node with id.
Type
OGMNeoOperation

(static) exists(query) → {Promise.<(boolean|Error)>}

Check if there is relation nodes that matches parameters query.
Parameters:
Name Type Description
query OGMNeoRelationQuery Query filter.
Source:
Returns:
True if there is some relation matching parameters and false otherwise if fulfilled, or some neo4j error if rejected.
Type
Promise.<(boolean|Error)>

(static) find(query) → {Promise.<(array|Error)>}

Find relation nodes.
Parameters:
Name Type Description
query OGMNeoRelationQuery Query filter.
Source:
Returns:
Found relation if fulfilled, or some neo4j error if rejected.
Type
Promise.<(array|Error)>

(static) findNodes(query, nodesopt, distinctopt) → {Promise.<(array|Error)>}

Find start and end nodes for the relation. Do not return relation properties to find relation properties use find or find populated.
Parameters:
Name Type Attributes Default Description
query OGMNeoRelationQuery Query filter.
nodes string <optional>
'both' The return nodes. 'both'/null = return start and end nodes, 'start' = return start nodes, 'end' = return end nodes
distinct boolean <optional>
false Add distinct clause to cypher return.
Source:
Returns:
Found populated relation if fulfilled, or some neo4j error if rejected.
Type
Promise.<(array|Error)>

(static) findNodesOperation(query, nodesopt, distinctopt) → {OGMNeoOperation}

Operation to find start and end nodes for the relation. Do not return relation properties to find relation properties use find or find populated.
Parameters:
Name Type Attributes Default Description
query OGMNeoRelationQuery Query filter.
nodes string <optional>
'both' The return nodes. 'both'/null = return start and end nodes, 'start' = return start nodes, 'end' = return end nodes
distinct boolean <optional>
false Add distinct clause to cypher return.
Source:
Throws:
Will throw an error if the query object was null or not an instance of ogmneo.RelationQuery.
Type
Error
Returns:
Operation that find start and end nodes with query.
Type
OGMNeoOperation

(static) findOne(query) → {Promise.<(object|Error)>}

Find one relation node.
Parameters:
Name Type Description
query OGMNeoRelationQuery Query filter.
Source:
Returns:
Found relation if fulfilled, or some neo4j error if rejected.
Type
Promise.<(object|Error)>

(static) findOneOperation(query) → {OGMNeoOperation}

Operation to find one relation node that matches query.
Parameters:
Name Type Description
query OGMNeoRelationQuery Query filter.
Source:
Throws:
Will throw an error if the query object was null or not an instance of OGMNeoRelationQuery.
Type
Error
Returns:
Operation that find one relation node.
Type
OGMNeoOperation

(static) findOnePopulated(query) → {Promise.<(object|Error)>}

Find one Populated relation node.
Parameters:
Name Type Description
query OGMNeoRelationQuery Query filter.
Source:
Returns:
Populated found relation if fulfilled, or some neo4j error if rejected.
Type
Promise.<(object|Error)>

(static) findOnePopulatedOperation(query) → {OGMNeoOperation}

Operation to find one populated relation node.
Parameters:
Name Type Description
query OGMNeoRelationQuery Query filter.
Source:
Throws:
Will throw an error if the query object was null or not an instance of ogmneo.RelationQuery.
Type
Error
Returns:
Operation that find one populated relation node.
Type
OGMNeoOperation

(static) findOperation(query) → {OGMNeoOperation}

An operation that finds relation nodes that matches queries.
Parameters:
Name Type Description
query OGMNeoRelationQuery Query filter.
Source:
Throws:
Will throw an error if the query object was null or not an instance of OGMNeoRelationQuery.
Type
Error
Returns:
Operation that find the relation nodes.
Type
OGMNeoOperation

(static) findPopulated(query) → {Promise.<(array|Error)>}

Find relation nodes with start and end nodes populated.
Parameters:
Name Type Description
query OGMNeoRelationQuery Query filter.
Source:
Returns:
Found populated relation if fulfilled, or some neo4j error if rejected.
Type
Promise.<(array|Error)>

(static) findPopulatedOperation(query) → {OGMNeoOperation}

Operation that find relation nodes with start and end nodes populated.
Parameters:
Name Type Description
query OGMNeoRelationQuery Query filter.
Source:
Throws:
Will throw an error if the query object was null or not an instance of ogmneo.RelationQuery.
Type
Error
Returns:
Operation that find relations nodes.
Type
OGMNeoOperation

(static) relate(nodeId, otherNodeId, type, propertiesopt, uniqueopt) → {Promise.<(object|Error)>}

Creates a relation between two nodes if they both exists.
Parameters:
Name Type Attributes Default Description
nodeId integer Id of the start node in the relation.
otherNodeId integer Id of the end node in the relation.
type string Case sensitive relation type name.
properties object <optional>
{} Relation properties.
unique bool <optional>
false If include unique clause on create statement.
Source:
Returns:
Created relation literal object if fulfilled, or some neo4j error if rejected.
Type
Promise.<(object|Error)>

(static) relateOperation(nodeId, otherNodeId, type, propertiesopt, uniqueopt) → {OGMNeoOperation}

Operation that creates a relation between two nodes if they both exists.
Parameters:
Name Type Attributes Default Description
nodeId integer First in relation node id.
otherNodeId integer Second in relation node id.
type string Case sensitive relation type name.
properties object <optional>
{} Relation properties.
unique bool <optional>
false If include unique clause on create statement.
Source:
Throws:
  • Will throw an error if the ids from node was not integers.
    Type
    Error
  • Will throw an error if a relatioship type was not an non-empty string.
    Type
    Error
Returns:
Operation that creates the relation between nodes.
Type
OGMNeoOperation

(static) update(relationId, newProperties) → {Promise.<(object|Error)>}

Update a relation propeties if it exists.
Parameters:
Name Type Description
relationId integer Relation node id.
newProperties object Relation NEW properties.
Source:
Returns:
Updated relation literal object if fulfilled, or some neo4j error if rejected.
Type
Promise.<(object|Error)>

(static) updateMany(newProperties, query) → {Promise.<(array|Error)>}

Set or update newPropeties on all relation nodes that matches parameters query.
Parameters:
Name Type Description
newProperties object New properties ot be set or updated.
query OGMNeoRelationQuery Query filter.
Source:
Returns:
Updated nodes if fulfilled, or some neo4j error if rejected.
Type
Promise.<(array|Error)>

(static) updateManyOperation(newProperties, query) → {OGMNeoOperation}

Operation that set or update newPropeties on all relation nodes that matches parameters query.
Parameters:
Name Type Description
newProperties object New properties ot be set or updated.
query OGMNeoRelationQuery Query filter.
Source:
Throws:
  • Will throw an error if query was not an instance of ogmneo.RelationQuery.
    Type
    Error
  • Will throw an error if newProperties was not an object.
    Type
    Error
  • Will throw an error if newProperties was was empty.
    Type
    Error
Returns:
Operation that updates properties on the relation nodes.
Type
OGMNeoOperation

(static) updateOperation(relationId, newProperties) → {OGMNeoOperation}

Operation that updates a relation propeties if it exists.
Parameters:
Name Type Description
relationId integer Relation node id.
newProperties object Relation NEW properties.
Source:
Throws:
Will throw an error if the id from relation node was not integer.
Type
Error
Returns:
Operation that creates the relation between nodes.
Type
OGMNeoOperation