Skip to content

Instantly share code, notes, and snippets.

@peterzawistowicz
Created September 24, 2015 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterzawistowicz/53e938f342b9dcd2aaf4 to your computer and use it in GitHub Desktop.
Save peterzawistowicz/53e938f342b9dcd2aaf4 to your computer and use it in GitHub Desktop.
my $client = MongoDB->connect();
my $coll = $client->ns("test.foo");
# do insert with number-like strings inserted as numbers
{
my $coll2 = $coll->with_codec( prefer_numeric => 1 );
$coll2->insert( answer => "42" ); # inserted as numeric 42
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment