Mandel::Relationship::HasMany - A field relates to many other mongodb document
Using DSL from Mandel::Document:
package MyModel::Cat; use Mandel::Document; has_many owners => 'MyModel::Person';
Using object oriented interface:
MyModel::Cat ->model ->relationship(has_many => owners => 'MyModel::Person');
Will add:
$cat = MyModel::Cat->new->add_owners(\%args, $cb); $cat = MyModel::Cat->new->add_owners($person_obj, $cb); $person_obj = MyModel::Cat->new->add_owners(\%args); $person_obj = MyModel::Cat->new->add_owners($person_obj); $persons = MyModel::Cat->new->search_owners; $person_objs = MyModel::Cat->new->owners; $self = MyModel::Cat->new->owners(sub { my($self, $err, $person_objs) = @_; });
See also "relationship" in Mandel::Model.
The name of the method used to add another document to the .
The name of the method used to search related documents.
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.