praveenchappa has asked for the wisdom of the Perl Monks concerning the following question:
I am tryinh to connet to mongo db on a remote machine and query on a database its working fine but i want get the status code of the query wheter it is executed or any syntax errors..
my $conn = MongoDB::Connection->new( host => 'hostname', port => 27017, username=>'xxxx', password=>'xxxx', db_name => 'xxxx' ); my $database = $conn->get_database( 'xxxx' ); my $collection = $database->get_collection( 'student' ); my $data = $collection->find({"id"=>"stu_7";}); #i want to check exit or status code here !!!!!!! #...... while (my $doc = $data->next) { my @qual=@{$doc->{'qualifications'}}; print @qual; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to capture status codes of mongodb in perl
by blindluke (Hermit) on Nov 05, 2014 at 11:09 UTC | |
by praveenchappa (Acolyte) on Nov 05, 2014 at 12:29 UTC | |
by choroba (Cardinal) on Nov 05, 2014 at 12:44 UTC | |
by blindluke (Hermit) on Nov 05, 2014 at 16:00 UTC |