#!/usr/bin/env perl

use feature qw'say' ;
use strict ;
use warnings ;

use DateTime ;
use Data::Dumper ;

use lib '/home/jacoby/lib' ;
use MongoConnect ; #handles access to mongo database so passwords need not show up in gists
$MongoConnect::Database = 'local' ; # which of all possible Mongo DBs should I connect to?

my $today = DateTime->now()->set_time_zone( 'America/New_York' )->ymd ; # 2015-05-12

say $today ;

my $client     = get_client() ; #think "MongoDb::MongoClient->new()"
my $database   = $client->get_database( 'fitbit' ) ;
my $collection = $database->get_collection( 'daily_reads' ) ;

my $find   = $collection->find ;
say Dumper $find ;

$find   = $collection->find_one( { date => $today }) ;
say Dumper $find ;