Skip to content
Snippets Groups Projects
Commit 8374d4ed authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files
parents 4ff59856 fb34814d
Branches
No related tags found
No related merge requests found
...@@ -97,7 +97,11 @@ sub get_project ...@@ -97,7 +97,11 @@ sub get_project
{ {
if ($be eq 'TA::Hasher') { require TA::Hasher; } if ($be eq 'TA::Hasher') { require TA::Hasher; }
elsif ($be eq 'TA::UrxnBla') { require TA::UrxnBla; } elsif ($be eq 'TA::UrxnBla') { require TA::UrxnBla; }
elsif ($be eq 'MongoDB') { require MongoDB; } elsif ($be eq 'MongoDB')
{
require MongoDB;
require MongoDB::MongoClient;
}
else else
{ {
print "ATTN: unknown backend '$be'\n"; print "ATTN: unknown backend '$be'\n";
...@@ -728,14 +732,16 @@ sub connect_MongoDB ...@@ -728,14 +732,16 @@ sub connect_MongoDB
my $cfg= shift; my $cfg= shift;
my $cmm= $cfg->{'MongoDB'}; my $cmm= $cfg->{'MongoDB'};
# print "cmm: ", main::Dumper ($cmm); my %cmm_c= map { $_ => $cmm->{$_} } qw(host username password db_name);
# print "cmm_c: ", main::Dumper (\%cmm_c);
my ($db, $col0, $col1, $col2); my ($db, $col0, $col1, $col2);
eval eval
{ {
my $connection= MongoDB::Connection->new(host => $cmm->{'host'}); my $connection= new MongoDB::MongoClient( %cmm_c );
$connection->authenticate($cmm->{'db'}, $cmm->{'user'}, $cmm->{'pass'}); print "connection=[$connection]\n";
$db= $connection->get_database($cmm->{'db'}); # $connection->authenticate($cmm->{'db'}, $cmm->{'user'}, $cmm->{'pass'});
$db= $connection->get_database($cmm->{'db_name'});
$col0= $db->get_collection($cmm->{'maint'}); $col0= $db->get_collection($cmm->{'maint'});
$col1= $db->get_collection($cmm->{'catalog'}); $col1= $db->get_collection($cmm->{'catalog'});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment