The Perl Advent Calendar needs more articles for 2022. Submit your idea today!

NAME

Neo4j::Driver::ServerInfo - Provides Neo4j server address and version

VERSION

version 0.31

SYNOPSIS

 use Neo4j::Driver;
 $session = Neo4j::Driver->new->basic_auth(...)->session;
 
 $host_port = $session->server->address;
 $version_string = $session->server->version;
 say "Contacting $version_string at $host_port.";

DESCRIPTION

Provides some basic information of the server where the result is obtained from.

To obtain server info, call "server" in Neo4j::Driver::Session.

METHODS

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

address

 $host_port = $session->server->address;

Returns the host name and port number of the server. Takes the form of an URL authority string (for example: localhost:7474).

agent

 $agent_string = $session->server->agent;

Returns the product name and version number. Takes the form of a server agent string (for example: Neo4j/3.5.17).

protocol_version

 $bolt_version = $session->server->protocol_version;

Returns the Bolt protocol version with which the remote server communicates. Takes the form of a string "$major.$minor" where the major and minor version numbers both are integers.

When the HTTP protocol is used instead of Bolt, this method returns an undefined value.

If the Bolt protocol is used, but the version number is unknown, an empty string is returned. This situation shouldn't occur unless you use Neo4j::Bolt version 0.20 or older.

version

 $agent_string = $session->server->version;

Alias for agent().

Use of version() is discouraged since version 0.26. This method may be deprecated and removed in future.

SEE ALSO

AUTHOR

Arne Johannessen <ajnn@cpan.org>

COPYRIGHT AND LICENSE

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

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)