NAME

Neo4j::Driver::Record - Container for Cypher result values

VERSION

version 1.02

SYNOPSIS

$record = $session->execute_write( sub ($transaction) {
  return $transaction->run( ... )->fetch;
});

$value = $record->get('name');  # field key
$value = $record->get(0);       # field index

# Shortcut for records with just a single key
$value = $record->get;

DESCRIPTION

Container for Cypher result values. Records are returned from Cypher query execution, contained within a Result. A record is a form of ordered map and, as such, contained values can be accessed by either positional index or textual key.

To obtain a record, call "fetch" in Neo4j::Driver::Result.

METHODS

Neo4j::Driver::Record implements the following methods.

get

$value1 = $record->get('field_key');
$value2 = $record->get(2);

Get a value from this record, either by field key or by zero-based index.

When called without parameters, get() will return the first field. If there is more than a single field, a warning in the category ambiguous will be issued.

$value = $session->run('RETURN "It works!"')->single->get;
$value = $session->run('RETURN "warning", "ambiguous"')->single->get;

Values are returned from Neo4j as Neo4j::Types objects and as simple Perl references / scalars. For details and for known issues with type mapping see Neo4j::Driver::Types.

data

$hashref = $record->data;
$value = $hashref->{field_key};

Return the keys and values of this record as a hash reference.

SEE ALSO

AUTHOR

Arne Johannessen (AJNN)

COPYRIGHT AND LICENSE

This software is Copyright (c) 2016-2024 by Arne Johannessen.

This is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0 or (at your option) the same terms as the Perl 5 programming language system itself.