NAME

ArangoDB::Collection

DESCRIPTION

A instance of ArangoDB collection.

METHODS

new($connection, $collection_info)

Constructor.

id()

Returns identifer of the collection.

status()

Returns status of the collection.

is_newborn()

Return true if status of the collection is 'new born'.

is_unloaded()

Return true if status of the collection is 'unloaded'.

is_loaded()

Return true if status of the collection is 'loaded'.

is_being_unloaded()

Return true if status of the collection is 'being unloaded'.

is_deleted()

Return true if status of the collection is 'deleted'.

is_corruped()

Return true if status of the collection is invalid.

name($name)

Returns name of collection. If $name is set, rename the collection.

count()

Returns number of documents in the collection.

figure($type)

Returns number of documents and additional statistical information about the collection.

$type is key name of figures.The key names are:

count

The number of documents inside the collection.

alive-count

The number of living documents.

alive-size
The total size in bytes used by all living documents.
dead-count

The number of dead documents.

dead-size

The total size in bytes used by all dead documents.

dead-deletion

The total number of deletion markers.

datafiles-count

The number of active datafiles.

datafiles-fileSize

The total filesize of datafiles.

journals-count

The number of journal files.

journals-fileSize

The total filesize of journal files.

journalSize

The maximal size of the journal in bytes.

wait_for_sync($boolean)

Set or get the property 'wait_for_sync' of the collection.

drop()

Drop the collection.

truncate()

Truncate the collection.

load()

Load the collection.

unload()

Unload the collection.

document($doc_id)

Get documnet in the collection.

all_document_ids()

Returns list of document id in the collection.

save($data)

Save document to the collection.

bulk_import($header,$body)

Import multiple documents at once.

$header is ARRAY reference of attribute names. $body is ARRAY reference of document values.

Example

$collection->bulk_import(
    [qw/fistsName lastName age gender/],
    [
        [ "Joe", "Public", 42, "male" ],
        [ "Jane", "Doe", 31, "female" ],
    ]
);    

bulk_import_self_contained($documents)

Import multiple self-contained documents at once.

$documents is the ARRAY reference of documents.

update($doc_id,$data)

Update document in the collection.

delete($doc_id)

Delete document in the collection.

any_edges($vertex)

Returns the list of edges starting or ending in the vertex identified by $vertex.

in_edges($vertex)

Returns the list of edges ending in the vertex identified by $vertex.

out_edges($vertex)

Returns the list of edges starting in the vertex identified by $vertex.

edge($edge_id)

Get edge in the collection.

save_edge($from,$to,$data)

Save edge to the collection.

update_edge($edge_id,$data)

Update edge in the collection.

delete_edge($edge_id)

Remoce edge in the collection.

all($options)

Send 'all' simple query. Returns all documents of in the collection.

$options is query option(HASH reference).The attributes of $options are:

limit

The maximal amount of documents to return. (optional)

skip

The documents to skip in the query. (optional)

by_example($example,$options)

Send 'by_example' simple query. This will find all documents matching a given example.

$example is the exmaple. $options is query option(HASH reference).The attributes of $options are:

limit

The maximal amount of documents to return. (optional)

skip

The documents to skip in the query. (optional)

first_example($example)

Send 'first_example' simple query. This will return the first document matching a given example.

$example is the exmaple.

range($attr,$lower,$upper,$options)

Send 'range' simple query. It looks for documents in the collection with attribute between two values.

Note: You must declare a skip-list index on the attribute in order to be able to use a range query.

$attr is the attribute path to check. $lower is the lower bound. $upper is the upper bound. $options is query option(HASH reference).The attributes of $options are:

closed

If true, use intervall including $lower and $upper, otherwise exclude $upper, but include $lower

limit

The maximal amount of documents to return. (optional)

skip

The documents to skip in the query. (optional)

near($latitude,$longitude,$options)

Send 'near' simple query. The default will find at most 100 documents near a given coordinate. The returned list is sorted according to the distance, with the nearest document coming first.

$latitude is the latitude of the coordinate. $longitude is longitude of the coordinate. $options is query option(HASH reference).The attributes of $options are:

distance

If given, the attribute key used to store the distance. (optional)

limit

The maximal amount of documents to return. (optional)

skip

The documents to skip in the query. (optional)

geo

If given, the identifier of the geo-index to use. (optional)

within($latitude,$longitude,$radius,$options)

Send 'within' simple query. This will find all documents with in a given radius around the coordinate (latitude, longitude). The returned list is sorted by distance.

$latitude is the latitude of the coordinate. $longitude is longitude of the coordinate. $radius is the maximal radius. $options is query option(HASH reference).The attributes of $options are:

distance

If given, the attribute key used to store the distance. (optional)

limit

The maximal amount of documents to return. (optional)

skip

The documents to skip in the query. (optional)

geo

If given, the identifier of the geo-index to use. (optional)

ensure_hash_index($fileds)

Create hash index for the collection.

$fileds is the field of index.

ensure_unique_constraint($fileds)

Create unique hash index for the collection.

$fileds is the field of index.

ensure_skiplist($fileds)

Create skiplist index for the collection.

$fileds is the field of index.

ensure_unique_skiplist($fileds)

Create unique skiplist index for the collection.

$fileds is the field of index.

ensure_geo_index($fileds,$is_geojson)

Create geo index for the collection.

$fileds is the field of index. $is_geojson is boolean flag. If it is true, then the order within the list is longitude followed by latitude.

ensure_geo_constraint($fileds,$ignore_null)

It works like ensure_geo_index() but requires that the documents contain a valid geo definition.

$fileds is the field of index. $ignore_null is boolean flag. If it is true, then documents with a null in location or at least one null in latitude or longitude are ignored.

ensure_cap_constraint($size)

Create cap constraint for the collection.

get_index($index_id)

Returns index object.

drop_index($index_id)

Drop the index.

indexes()

Returns list of indexes of the collection.

5 POD Errors

The following errors were encountered while parsing the POD:

Around line 36:

You forgot a '=back' before '=head2'

Around line 631:

'=item' outside of any '=over'

Around line 667:

You forgot a '=back' before '=head2'

Around line 827:

You forgot a '=back' before '=head2'

Around line 945:

=back without =over