strict;
use warnings;
our $VERSION = 0.14;
use base qw(CohortExplorer::Datasource);
use JSON qw( decode_json );
#-------
sub authenticate {
my ( $self, %opts ) = @_;
my $ds_name = $self->name;
r
Accept => "application/json"
);
my $res = $ua->request($req);
my $code = $res->code;
if ( $code == 200 ) {
my $json = decode_json( $res->decoded_content );
if ( $json->{type} ne 'mongodb' )
w = map { $_ => 1 } @{ $json->{view} || [] };
my @tables = @{ $json->{table} || [] };
# Get all base tables ( i.e. exclude views )
my @base_tables =
defined $json->{view} ? grep { not $