Neo4j::Driver::Type::Node - Describes a node from a Neo4j graph
version 0.28
$query = 'MATCH (m:Movie) RETURN m LIMIT 1'; $node = $driver->session->run($query)->single->get('m'); say 'Movie # ', $node->id(), ' :'; say ' ', $node->get('name'), ' / ', $node->get('year'); say ' Labels: ', join ', ', $node->labels;
Describes a node from a Neo4j graph. A node may be a part of records returned from Cypher statement execution. Its description contains the node's properties as well as certain meta data, all accessible by methods that this class provides.
Neo4j::Driver::Type::Node objects are not in a one-to-one relation with nodes in a Neo4j graph. If the same Neo4j node is fetched multiple times, then multiple distinct Neo4j::Driver::Type::Node objects will be created by the driver. If your intention is to verify that two Neo4j::Driver::Type::Node objects in Perl describe the same node in the Neo4j database, you need to compare their IDs.
Neo4j::Driver::Type::Node inherits all methods from Neo4j::Types::Node.
$value = $node->get('property_key');
See "get" in Neo4j::Types::Node.
$id = $node->id;
See "id" in Neo4j::Types::Node.
@labels = $node->labels;
See "labels" in Neo4j::Types::Node.
$hashref = $node->properties; $value = $hashref->{property_key};
See "properties" in Neo4j::Types::Node.
Neo4j::Driver::Type::Node implements the following experimental features. These are subject to unannounced modification or removal in future versions. Expect your code to break if you depend upon these features.
$count = $node->labels;
The labels() method returns the number of labels if called in scalar context.
labels()
Until version 0.25, it died instead.
die
The value of properties named _meta, _node, or _labels may not be returned correctly.
_meta
_node
_labels
When using HTTP JSON, the labels of nodes that are returned as part of a Neo4j::Driver::Type::Path are unavailable, because that information is not currently reported by the Neo4j server. undef is returned instead.
labels
undef
Neo4j::Driver
Neo4j::Types::Node
Equivalent documentation for the official Neo4j drivers: Node (Java), Node (Python)
Arne Johannessen <ajnn@cpan.org>
This software is Copyright (c) 2016-2022 by Arne Johannessen.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Neo4j::Driver, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Neo4j::Driver
CPAN shell
perl -MCPAN -e shell install Neo4j::Driver
For more information on module installation, please visit the detailed CPAN module installation guide.