Mandel::Relationship::BelongsTo - A document is owned by another mongodb document
Using DSL from Mandel::Document:
package MyModel::Cat; use Mandel::Document; belongs_to owner => 'MyModel::Person';
Using object oriented interface:
MyModel::Cat ->model ->relationship(belongs_to => owner => 'MyModel::Person');
Will add:
$cat = MyModel::Cat->new->owner(\%args, $cb); $cat = MyModel::Cat->new->owner($person_obj, $cb); $person_obj = MyModel::Cat->new->owner(\%args); $person_obj = MyModel::Cat->new->owner($person_obj); $cat = MyModel::Cat->new->owner($bson_oid); $person = MyModel::Cat->new->owner; $self = MyModel::Cat->new->owner(sub { my($self, $err, $person) = @_; });
See also "relationship" in Mandel::Model.
The name of the field in this class which hold the "_id" to the related doc.
Add methods to "document_class" in Mandel::Relationship.
Mojolicious, Mango, Mandel::Relationship
Jan Henning Thorsen - jhthorsen@cpan.org
jhthorsen@cpan.org
To install Mandel, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mandel
CPAN shell
perl -MCPAN -e shell install Mandel
For more information on module installation, please visit the detailed CPAN module installation guide.