The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
package AA;
use Moose;
has name => qw(isa Str is rw);

use v5.14;
use MongoDB;
;

my $connection = MongoDB::Connection->new;
my $db   = $connection->_mongoose_testing;
my $collection = $db->bar;
my $aa = AA->new( name => 'doddle' );
my $id         = $collection->insert({ ts => DateTime->now, aa=>$aa });
$collection->save;