Class: OGMNeoNode

OGMNeoNode()

new OGMNeoNode()

Source:

Methods

(static) addLabelToNode(label, nodeId) → {Promise.<(object|Error)>}

Adding label to a node.
Parameters:
Name Type Description
label string The label to be added to the node.
nodeId integer The id of the node to add the label.
Source:
Returns:
Node(if node exists) or null(if not exists) if fulfilled, some error if rejected.
Type
Promise.<(object|Error)>

(static) addLabelToNodeOperation(label, nodeId) → {OGMNeoOperation}

Operation to add a label to a node.
Parameters:
Name Type Description
label string The label to be added to the node.
nodeId integer The id of the node to add the label.
Source:
Throws:
  • Will throw an error if the nodeId was not an integer value.
    Type
    Error
  • Will throw an error if the label was anything diferent than an non-empty string.
    Type
    Error
Returns:
Operation that adds a label.
Type
OGMNeoOperation

(static) addLabelToNodes(label, nodesIds) → {Promise.<(array|Error)>}

Adding label to nodes.
Parameters:
Name Type Description
label string The label to be added to the node.
nodesIds array The ids of the nodes to add the label.
Source:
Returns:
Nodes(if nodes exists) or null(if not exists) if fulfilled, some error if rejected.
Type
Promise.<(array|Error)>

(static) addLabelToNodesOperation(label, nodesIds) → {OGMNeoOperation}

Operation that adds a label to nodes.
Parameters:
Name Type Description
label string The label to be added to the node.
nodesIds array The ids of the nodes to add the label.
Source:
Throws:
  • Will throw an error if you don't provide at least one valid id to this operation.
    Type
    Error
  • Will throw an error if the label was anything diferent than an non-empty string.
    Type
    Error
Returns:
Operation that removes a label.
Type
OGMNeoOperation

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

Count of nodes with the query.
Parameters:
Name Type Description
query OGMNeoQuery The query to filter nodes that have to be counted.
Source:
Returns:
Count of nodes if fulfilled, some neo4j error if rejected.
Type
Promise.<(integer|Error)>

(static) countOperation(query) → {OGMNeoOperation}

Creates an operation count of nodes with a query object.
Parameters:
Name Type Description
query OGMNeoQuery The query to filter nodes that have to be counted.
Source:
Throws:
Will throw an error if the query was not a instance of ogmneo.Query.
Type
Error
Returns:
Operation that query the count of the nodes with query.
Type
OGMNeoOperation

(static) countWithLabel(label) → {Promise.<(integer|Error)>}

Count of nodes with the label.
Parameters:
Name Type Description
label string The label of nodes that have to be counted.
Source:
Returns:
Count of nodes if fulfilled, some neo4j error if rejected.
Type
Promise.<(integer|Error)>

(static) create(node, labelopt) → {Promise.<(object|Error)>}

Creates a node on neo4j.
Parameters:
Name Type Attributes Default Description
node object The literal object with node propeperties.
label string <optional>
null The label of the node. Default null is a node without label.
Source:
Returns:
Created node literal object if fulfilled, or some neo4j error if rejected.
Type
Promise.<(object|Error)>

(static) createOperation(node, labelopt) → {OGMNeoOperation}

Operation that creates a node on neo4j.
Parameters:
Name Type Attributes Default Description
node object The literal object with node propeperties.
label string <optional>
null The label of the node. Default null is a node without label.
Source:
Returns:
Create node operation that can be executed later.
Type
OGMNeoOperation

(static) delete(node) → {Promise.<(boolean|Error)>}

Deletes a node on neo4j.
Parameters:
Name Type Description
node object The literal object with node propeperties and required node.id.
Source:
Returns:
True if fulfilled and found and delete node, false if not found object to delete, or error if node.id is invalid or some neo4j error if rejected.
Type
Promise.<(boolean|Error)>

(static) deleteCascade(node) → {Promise.<(boolean|Error)>}

Deletes a node and it's relation from database.
Parameters:
Name Type Description
node object The literal object with node propeperties and required node.id.
Source:
Returns:
True if fulfilled and found and delete node, false if not found object to delete, or error if node.id is invalid or some neo4j error if rejected.
Type
Promise.<(boolean|Error)>

(static) deleteCascadeOperation(node) → {OGMNeoOperation}

Operation that deletes a node and it's relation from database.
Parameters:
Name Type Description
node object The literal object with node propeperties and required node.id.
Source:
Throws:
Will throw an error if the node.id was not integer or not exists.
Type
Error
Returns:
Operation that deletes a node.
Type
OGMNeoOperation

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

Deletes every node that matches the ogmneo.Query.
Parameters:
Name Type Description
query OGMNeoQuery The query to filter the nodes.
Source:
Returns:
Number of nodes deleted if fulfilled or some neo4j error if rejected.
Type
Promise.<(number|Error)>

(static) deleteManyOperation(query) → {OGMNeoOperation}

Creates an operation that deletes every node that matches the query.
Parameters:
Name Type Description
query OGMNeoQuery The query to filter the nodes.
Source:
Throws:
Will throw an error if the query was not a instance of ogmneo.Query.
Type
Error
Returns:
Operation that deletes the matched nodes.
Type
OGMNeoOperation

(static) deleteOperation(node) → {OGMNeoOperation}

Operation that deletes a node on neo4j.
Parameters:
Name Type Description
node object The literal object with node propeperties and required node.id.
Source:
Throws:
Will throw an error if the node.id was not integer or not exists.
Type
Error
Returns:
Operation that deletes a node.
Type
OGMNeoOperation

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

Find nodes filtered by query parameter.
Parameters:
Name Type Description
query OGMNeoQuery The query to filter nodes that have to be returned.
Source:
Returns:
Nodes if fulfilled, some neo4j error if rejected.
Type
Promise.<(array|Error)>

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

Find one node filtered by query parameter. Will return the first node that it finds.
Parameters:
Name Type Description
query OGMNeoQuery The query to filter nodes that have to be returned.
Source:
Returns:
Node found if fulfilled, some neo4j error if rejected.
Type
Promise.<(object|Error)>

(static) findOneOperation(query) → {OGMNeoOperation}

Operation that find one node filtered by query parameter.
Parameters:
Name Type Description
query OGMNeoQuery The query to filter nodes that have to be returned.
Source:
Throws:
Will throw an error if the query was not a instance of ogmneo.Query.
Type
Error
Returns:
Operation that returns the node with query.
Type
OGMNeoOperation

(static) findOperation(query) → {OGMNeoOperation}

Operation for find nodes filtered by the query parameter.
Parameters:
Name Type Description
query OGMNeoQuery The query to filter nodes that have to be returned.
Source:
Throws:
Will throw an error if the query was not a instance of ogmneo.Query.
Type
Error
Returns:
Operation that returns the nodes with query.
Type
OGMNeoOperation

(static) manyWithIds(ids) → {Promise.<(array|Error)>}

Retrive nodes with ids.
Parameters:
Name Type Description
ids array The ids of nodes that are wanted.
Source:
Returns:
An array of nodes if found fulfilled or null if not found fulfilled, or error if the ids are invalid or some neo4j error if rejected.
Type
Promise.<(array|Error)>

(static) manyWithIdsOperation(ids) → {OGMNeoOperation}

Operation to retrive nodes with ids.
Parameters:
Name Type Description
ids array The ids of nodes that are wanted.
Source:
Throws:
  • Will throw an error if you don't provide any valid id to retrive.
    Type
    Error
  • Will throw an error if the ids are not an array.
    Type
    Error
Returns:
Operation that query the nodes with the ids.
Type
OGMNeoOperation

(static) nodeWithId(id) → {Promise.<(object|Error)>}

Retrive node with id.
Parameters:
Name Type Description
id integer The id of node that's wanted.
Source:
Returns:
Object if found fulfilled or null if not found fulfilled, or error if the id is invalid or some neo4j error if rejected.
Type
Promise.<(object|Error)>

(static) nodeWithIdOperation(id) → {OGMNeoOperation}

Creates a operation that retrives a node with id.
Parameters:
Name Type Description
id integer The id of node that's wanted.
Source:
Throws:
Will throw an error if id was not an integer value.
Type
Error
Returns:
Operation retrives a node.
Type
OGMNeoOperation

(static) removeLabelFromNode(label, nodeId) → {Promise.<(object|Error)>}

Remove label from a node.
Parameters:
Name Type Description
label string The label to be removed from the node.
nodeId integer The id of the node to remove the label from.
Source:
Returns:
Node(if node exists) or null(if not exists) if fulfilled, some error if rejected.
Type
Promise.<(object|Error)>

(static) removeLabelFromNodeOperation(label, nodeId) → {OGMNeoOperation}

Operation to remove a label from a node.
Parameters:
Name Type Description
label string The label to be removed from the node.
nodeId integer The id of the node to remove the label from.
Source:
Throws:
  • Will throw an error if the nodeId was not an integer value.
    Type
    Error
  • Will throw an error if the label was anything diferent than an non-empty string.
    Type
    Error
Returns:
Operation that removes a label.
Type
OGMNeoOperation

(static) removeLabelFromNodes(label, nodeIds) → {Promise.<(array|Error)>}

Remove label from nodes.
Parameters:
Name Type Description
label string The label to be removed from the nodes.
nodeIds array The ids of the nodes to remove the label from.
Source:
Returns:
Nodes(if nodes exists) or null(if not exists) if fulfilled, some error if rejected.
Type
Promise.<(array|Error)>

(static) removeLabelFromNodesOperation(label, nodeIds) → {OGMNeoOperation}

Operation that removes a label from nodes.
Parameters:
Name Type Description
label string The label to be removed from the nodes.
nodeIds array The ids of the nodes to remove the label from.
Source:
Throws:
  • Will throw an error if you don't provide at least one valid id to this operation.
    Type
    Error
  • Will throw an error if the label was anything diferent than an non-empty string.
    Type
    Error
Returns:
Operation that removes a label from many nodes.
Type
OGMNeoOperation

(static) update(node) → {Promise.<(object|Error)>}

Updates a node on neo4j.
Parameters:
Name Type Description
node object The literal object with node propeperties and required node.id.
Source:
Returns:
Updated node literal object if fulfilled, or error if node.id is invalid or some neo4j error if rejected.
Type
Promise.<(object|Error)>

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

Update new properties on every node that matches the query.
Parameters:
Name Type Description
query OGMNeoQuery The query to filter the nodes.
newProperties object NEW properties.
Source:
Returns:
Updated nodes if fulfilled or some neo4j error if rejected.
Type
Promise.<(array|Error)>

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

Returns an operation that updates new properties on every node that matches the query.
Parameters:
Name Type Description
query OGMNeoQuery The query to filter the nodes.
newProperties object NEW properties.
Source:
Throws:
  • Will throw an error if the query is not an instance of ogmneo.Query.
    Type
    Error
  • Will throw an error if newProperties is not an object.
    Type
    Error
  • Will throw an error if newProperties don't have at least one property with NO undefined values to update.
    Type
    Error
Returns:
Operation that updates new properties on every node that matches the query.
Type
OGMNeoOperation

(static) updateOperation(node) → {OGMNeoOperation}

Operation that updates a node.
Parameters:
Name Type Description
node object The literal object with node propeperties and required node.id.
Source:
Throws:
Will throw an error if the node.id was not integer or not exists.
Type
Error
Returns:
Update node operation that can be executed later.
Type
OGMNeoOperation