Arango::Tango::Database - ArangoDB Database object
version 0.019
This class should not be created directly. The Arango::Tango module is responsible for creating instances of this object.
Arango::Tango::Database answers to the following methods:
Arango::Tango::Database
collection
my $collection = $database->collection("some_collection");
Opens an existing collection, and returns a reference to a Arango::Tango::Collection representing it.
clear_access_level
$db->clear_access_level($user) $db->clear_access_level($user, $collection)
Clears the database or collection access level for a specific user.
create_collection
my $col = $database->create_collection("col_name");
Creates a new collection and returns the object representing it (Arango::Tango::Collection).
create_ttl_index
$idx = $db->create_ttl_index("col_name", %args);
Creates a new index of type ttl for the given collection. The mandatory args are type (must be ttl), name (string, human name for the index), fields (array ref with the names of the document fields to be used as expiration timestamps) and expireAfter (integer, seconds). Returns an object containing the id of the created index and the confirmation of the provided arguments (type, name, fields and expireAfter). If an error occurs the error field will be true, otherwise false.
type
ttl
name
fields
expireAfter
cursor
my $cursor = $database->cursor( $aql_query, %opt );
Performs AQL queries, returning a cursor. An optional hash of options can be supplied. Supported hashes corresponds to the different attributes available in the ArangoDB REST API (https://docs.arangodb.com/3.4/HTTP/AqlQueryCursor/AccessingCursors.html).
delete
$db->delete;
Deletes the supplied database.
delete_collection
$database->delete_collection("col_name");
Deletes a collection.
get_indexes
$idxs = $db->get_indexes("col_name");
Returns an object containing an array reference with the details of the indexes presently defined for the given collection.
list_collections
my $cols = $database->list_collections;
Returns an array reference to the collections available in the database.
get_access_level
$perms = $db->get_access_level($user) $perms = $db->get_access_level($user, $collection)
Fetch the database or collection access level for a specific user.
set_access_level
$db->set_access_level($user, "rw") $db->set_access_level($user, "ro", $collection)
Set the database or collection access level for a specific user.
Alberto Simões <ambs@cpan.org>
This software is copyright (c) 2019-2023 by Alberto Simões.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Arango::Tango, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Arango::Tango
CPAN shell
perl -MCPAN -e shell install Arango::Tango
For more information on module installation, please visit the detailed CPAN module installation guide.