this repo has no description

Making sure all keys are saved as strings instead of ints so we don't try to pass a number in a string when it was saved as an integer

Changed files
+3 -3
lib
CHI
Driver
+3 -3
lib/CHI/Driver/MongoDB.pm
···
sub fetch {
my ( $self, $key ) = @_;
-
my $results = $self->collection->find_one( { _id => $key }, { data => 1 } );
+
my $results = $self->collection->find_one( { _id => "$key" }, { data => 1 } );
return ($results) ? $results->{data} : undef;
}
sub store {
my ( $self, $key, $data ) = @_;
-
$self->collection->save( { _id => $key, data => $data },
+
$self->collection->save( { _id => "$key", data => $data },
{ safe => $self->{safe} } );
return;
}
···
sub remove {
my ( $self, $key ) = @_;
-
$self->collection->remove( { _id => $key }, { safe => $self->{safe} } );
+
$self->collection->remove( { _id => "$key" }, { safe => $self->{safe} } );
return;
}