File: paired.pl

package info (click to toggle)
libmongodb-perl 0.45-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,960 kB
  • sloc: perl: 2,664; ansic: 1,694; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 484 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use strict;
use warnings;
use MongoDB;
use boolean;
use Data::Dumper;
use MongoDB::OID;
use Devel::Peek;
use Data::Dump;

my $m = MongoDB::Connection->new(left_host => "localhost", left_port => 27017, 
                                 right_host => "localhost", right_port => 27018);

my $db = $m->get_database("foo");
my $c = $db->get_collection("bar");

while (true) {
  print "finding...";
  eval {
    $c->find_one();
  };
  if ($@) {
    print $@;
  }
  print "\n";
  sleep 1;
}