You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a default but sub-classable serializing method to Meerkat::Role::Document... perhaps just expose the storage serializer?
I'm already defining the structure of the object in Mongo via Moose attributes, why should I have to do the same for a hash? This would make developing REST interfaces around Meerkat objects super simple:
For example:
package My::Model::Foo;
use Moose;
with 'Meerkat::Role::Document';
has somekey => (is => 'ro', isa => 'String');
has otherkey => (is => 'ro, isa => 'Bool');
__PACKAGE__->meta->make_immutable;
package Inside::Some::Dancer::Like::REST::Framework;
get 'things' => sub {
my $obj = meerkat->collection('foo')->find_one({somekey => 'doodad'});
return $obj? $obj->to_hash : sub {
status 404;
{ errormsg => "Can't find this thing" };
}->();
}
The text was updated successfully, but these errors were encountered:
Add a default but sub-classable serializing method to Meerkat::Role::Document... perhaps just expose the storage serializer?
I'm already defining the structure of the object in Mongo via Moose attributes, why should I have to do the same for a hash? This would make developing REST interfaces around Meerkat objects super simple:
For example:
The text was updated successfully, but these errors were encountered: