Help for this page

Select Code to Download


  1. or download this
    $users->insert_one( {
            "name" => "Joe",
            "age" => 52,
            "likes" => [qw/skiing math ponies/]
        });
    
  2. or download this
    $db->get_collection( 'users' )->insert_one( { a => 1, b => 1 } );
    
  3. or download this
    $rp = MongoDB::WriteConcern->new(); # w:1, wtimeout: 1000
    
    ...
            w        => 'majority',
            wtimeout => 10000, # milliseconds
        );
    
  4. or download this
        use Try::Tiny;
        use Safe::Isa; # provides $_isa
    ...
                ...
            }
        };
    
  5. or download this
    Returns a MongoDB::WriteConcern object constructed from "w", "write_co
    +ncern" and "j".
    
  6. or download this
    $coll->insert({ name => "John Doe", age => 42 });