- SEE ALSO
Mandel::Model - An object modelling a document
This class is used to descrieb the structure of document in mongodb.
The name of the collection in the database. Default is the plural form of "name".
The class name of the collection class. This default to Mandel::Collection.
The class name of the document this description is attached to. Default to an autogenerated class name.
$field_obj = $self->field('name'); $self = $self->field(name => \%meta); $self = $self->field(['name1', 'name2'], \%meta);
Used to define new field(s) or retrieve a defined Mandel::Model::Field object.
@fields = $self->fields;
Get list of Mandel::Model::Field objects in the order they were added to thie model.
$rel_obj = $self->relationship($type => $accessor => 'Other::Document::Class', %args); $rel_obj = $self->relationship($accessor);
This method is used to describe a relationship between two documents.
$accessor will be used as l<Mandel::Relationship/accessor>, "Other::Document::Class" will be used as "related_class" in Mandel::Relationship and
Mandel::Model/document_class will be used as "document_class" in Mandel::Relationship.
%args is passed on the the relationship constructor.
Returns a new instance of "collection_class".
Jan Henning Thorsen -