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/8ddd60661617404ca546 to your computer and use it in GitHub Desktop.
Save peterzawistowicz/8ddd60661617404ca546 to your computer and use it in GitHub Desktop.
my $client = MongoDB->connect();
my $coll = $client->ns("test.foo");
# do insert with w:majority
{
my $coll2 = $coll->clone( write_concern => { w => 'majority' } );
$coll2->insert( $doc );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment