I'm getting problems while filtering data from a MongoDB where documents have a "iso_date" field like
ISODate("2010-08-01T00:00:00Z")
in the following .php file,
<?php
$date_a = $_GET['date_a'];
$date_b = $_GET['date_b'];
$m = new MongoClient('mongodb://127.0.0.1:xxxxx');
$db = $m->db;
$collection = $db->collection;
$res = $collection->find(array(
'iso_date' => array('$gte' => $date_a, '$lte' => $date_b)
));
$m->close();
echo json_encode($res);
?>
where date_a and date_b are created in javascript. I've tried to add string "T00:00:00Z" to YYYY-MM-DD dates, but the result is always empty (and I'm sure it shouldn't be). How can I solve this? I'd like not to convert everything to strings, and to keep a datetime format.