php - Aggregation date range mystery -


i have kind of mongo

$date = (int)(date("ymdhis", strtotime("now -30 days"))); $date2 = (int)(date("ymdhis", strtotime("now")));      $visits_options2 = array(     array(         '$match' => array(                 'date' => array('$lte'=>$date2, '$gte'=>$date),                 'click'=>1             )         ),         array(             '$group' => array(                 "_id"=>array({lot of fields}),                 'cpc' => array('$sum' => '$cpc'),                 'visits' => array('$sum'=>1)             )         )     );  

the mystery comes when (having data sure) if use '$gte' on match works if use both $gte , $lte doesn't.

any clue of whats happening?

update: ok, got weirder. if use gte + lte on console (exact same query) works. if use gte , "now" date console says there no results (works fine) , mongo driver returns results if used "-30 days" date. looks funny.

solved: same problem, update mongo driver , works fine!


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -