Help for this page

Select Code to Download


  1. or download this
    #file: test.Mongo.pl
     use strict;
    ...
     my $doc    = $client->get_database('mydb')->get_collection('mycoll')-
    +>find_one();
     $client->disconnect;
     print Dumper $doc;
    
  2. or download this
    #file: test.Mango.pl
    
    ...
     sub mango { state $m = Mango->new($connect_string)}
     my $doc = mango->db('mydb')->collection('mycoll')->find_one();
     print Dumper $doc;
    
  3. or download this
    >  perl test.Mango.pl "$MONGO_STRING"       #OK.5
    -- Emit connect in Mojo::IOLoop::Client (1)
    ...
                              }, 'Mango::BSON::ObjectID' ),
                .....          
            };
    
  4. or download this
    >  perl test.Mango.pl "$ATLAS_STRING"       # ERROR:  Premature connec
    +tion close at /var/..../local/lib/perl5/Mango/Cursor/Query.pm line 11
    +2. 
    -- Emit connect in Mojo::IOLoop::Client (1)
    ...
    -- Emit drain in Mojo::IOLoop::Stream (0)
    -- Emit close in Mojo::IOLoop::Stream (2)
    Premature connection close at  /var/..../local/lib/perl5/Mango/Cursor/
    +Query.pm line 112.
    
  5. or download this
    Mojo::IOLoop::Stream::_read(/var/..../local/lib/perl5/Mojo/IOLoop/Stre
    +am.pm:103):
    103:      return if $! == EAGAIN || $! == EINTR || $! == EWOULDBLOCK;
      DB<8> x $!
    0  'Connection reset by peer'
    
  6. or download this
    my %extra;
    $extra{replica_set_name} = 'xxxx';
    $extra{tls} = 1;        #Note, it's "tls" (not "ssl" like it would be 
    +in the connection string)
    sub mango { state $m = Mango->new($connect_string, %extra);}