Class: Node
| Defined in: | lib/Node._coffee |
| Inherits: | PropertyContainer |
Overview
The class corresponding to a Neo4j node.
Property Summary
Properties inherited from PropertyContainer
Instance Method Summary
- - (String) toString() Return a string representation of this node.
- - (Node) save(_) Persist or update this node in the database.
- - (void) delete(_, force = false) Delete this node from the database.
- - (void) index(index, key, value, _) Add this node to the given index under the given key-value pair.
- - (Relationship) createRelationshipTo(otherNode, type, data, _) Create and "return" (via callback) a relationship of the given type and with the given properties from this node to another node.
- - (Relationship) createRelationshipFrom(otherNode, type, data, _) Create and "return" (via callback) a relationship of the given type and with the given properties from another node to this node.
- - (Array<Relationship>) getRelationships(type, _) Fetch and "return" (via callback) the relationships of the given type or types from or to this node.
- - (Array<Relationship>) outgoing(type, _) Fetch and "return" (via callback) the relationships of the given type or types from this node.
- - (Array<Relationship>) incoming(type, _) Fetch and "return" (via callback) the relationships of the given type or types to this node.
- - (Array<Relationship>) all(type, _) Fetch and "return" (via callback) the relationships of the given type or types from or to this node.
- - (Array<Node>) getRelationshipNodes(rels, _) Fetch and "return" (via callback) the nodes adjacent to this one following only relationships of the given type(s) and/or direction(s).
- - (Path) path(to, type, direction, maxDepth = 1, algorithm = 'shortestPath', _) Fetch and "return" (via callback) the shortest path, if there is one, from this node to the given node.
Inherited Method Summary
Methods inherited from PropertyContainer
Instance Method Details
- (String) toString()
Return a string representation of this node.
- (Node) save(_)
Persist or update this node in the database. "Returns" (via callback) this same instance after the save.
- (void) delete(_, force = false)
force flag and instead manually and explicitly delete known relationships beforehand.
Delete this node from the database. This will throw an error if this
node has any relationships on it, unless the force flag is passed in,
in which case those relationships are also deleted.
- (void) index(index, key, value, _)
Add this node to the given index under the given key-value pair.
- (Relationship) createRelationshipTo(otherNode, type, data, _)
Create and "return" (via callback) a relationship of the given type and with the given properties from this node to another node.
- (Relationship) createRelationshipFrom(otherNode, type, data, _)
Create and "return" (via callback) a relationship of the given type and with the given properties from another node to this node.
- (Array<Relationship>) getRelationships(type, _)
Fetch and "return" (via callback) the relationships of the given type or types from or to this node.
- (Array<Relationship>) outgoing(type, _)
Fetch and "return" (via callback) the relationships of the given type or types from this node.
- (Array<Relationship>) incoming(type, _)
Fetch and "return" (via callback) the relationships of the given type or types to this node.
- (Array<Relationship>) all(type, _)
Fetch and "return" (via callback) the relationships of the given type or types from or to this node.
- (Array<Node>) getRelationshipNodes(rels, _)
getAdjacentNodes().
Fetch and "return" (via callback) the nodes adjacent to this one following only relationships of the given type(s) and/or direction(s).
- (Path) path(to, type, direction, maxDepth = 1, algorithm = 'shortestPath', _)
Fetch and "return" (via callback) the shortest path, if there is one, from this node to the given node. Returns null if no path exists.