line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: ArangoDB Collection object |
2
|
|
|
|
|
|
|
package Arango::DB::Collection; |
3
|
|
|
|
|
|
|
$Arango::DB::Collection::VERSION = '0.006'; |
4
|
5
|
|
|
5
|
|
35
|
use warnings; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
195
|
|
5
|
5
|
|
|
5
|
|
27
|
use strict; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
780
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub _new { |
8
|
0
|
|
|
0
|
|
|
my ($class, %opts) = @_; |
9
|
0
|
|
|
|
|
|
return bless {%opts} => $class; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub create_document { |
13
|
0
|
|
|
0
|
1
|
|
my ($self, $body) = @_; |
14
|
0
|
0
|
|
|
|
|
die "Arango::DB | Refusing to store undefined body" unless defined($body); |
15
|
0
|
|
|
|
|
|
return $self->{arango}->_api('create_document', { database => $self->{database}, collection => $self->{name}, body => $body}) |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub document_paths { |
19
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
20
|
|
|
|
|
|
|
return $self->{arango}->_api('all_keys', { database => $self->{database}, collection => $self->{name}, type => "path"})->{result} |
21
|
0
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__END__ |