I want to search for records between two dates. Format of dates are in 'YYYY-MM-DD'. Problem is that when I submit form I got no data.
Does someone knows where is the problem?
Here is example of MongoDB record:
"id": 3,
    "date": "2015-07-19",
    "name": "StressTest",
    "first_test": 4279.558451,
    "second_test": 4296.838515,
    "third_test": 825.446594,
    "min": 2.827739,
    "max": 6071.036922,
    "station": "Alpha1"
}
and here is code that I am using:
$m = new MongoClient("mongodb://root:toor@localhost:55732/db");
$db = $m->$dbname;
$results;
$collection = $db->db;
if(isset($_POST['submit'])){
    $array = array();
    $array['telescope']=$_POST['teleskop'];
    $lowdate=$_POST["datepickerOD"];
    $highdate=$_POST["datepickerDO"];
    echo '{ date: {$gt: '.$lowdate.', $lt: '.$highdate.' } }';
    $array = json_decode('{ date: {$gt: '.$lowdate.', $lt: '.$highdate.' } }');
    $results = $collection->find($array)->limit(500);
    var_dump($results);
}
