line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mongoose::EmbeddedDocument; |
2
|
|
|
|
|
|
|
$Mongoose::EmbeddedDocument::VERSION = '2.01'; |
3
|
1
|
|
|
1
|
|
8129
|
use MooseX::Role::Parameterized; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
4
|
1
|
|
|
1
|
|
7409
|
use Mongoose::Meta::AttributeTraits; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
92
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
parameter '-engine' => ( isa => 'Mongoose::Role::Engine' ); |
7
|
|
|
|
|
|
|
parameter '-pk' => ( isa => 'ArrayRef[Str]' ); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
role { |
10
|
|
|
|
|
|
|
my $p = shift; |
11
|
|
|
|
|
|
|
with 'Mongoose::Document' => $p; |
12
|
|
|
|
|
|
|
}; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Mongoose::EmbeddedDocument - role for embedded documents |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
package Address; |
21
|
|
|
|
|
|
|
use Moose; |
22
|
|
|
|
|
|
|
with 'Mongoose::EmbeddedDocument'; |
23
|
|
|
|
|
|
|
has 'street' => is=>'rw', isa=>'Str'; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
package Person; |
26
|
|
|
|
|
|
|
use Moose; |
27
|
|
|
|
|
|
|
with 'Mongoose::Document'; |
28
|
|
|
|
|
|
|
has 'address' => ( is=>'rw', isa=>'Address' ); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 DESCRIPTION |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
This role is a copy of C<Mongoose::Document>, but flags the class |
33
|
|
|
|
|
|
|
as 'embedded' so that it's collapsed into a single parent document |
34
|
|
|
|
|
|
|
in the database. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 SEE ALSO |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Read the Mongoose intro or cookbook. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
From the MongoDB docs: L<http://www.mongodb.org/display/DOCS/Updating+Data+in+Mongo#UpdatingDatainMongo-EmbeddingDocumentsDirectlyinDocuments> |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |