php - Using conditions in Phalcon MongoDB (ODM) -


i retrieve records has enddate 'lesser' "today". below come out with, not work. advice appreciated.

$records = records::find(array(         '$lte' => array(             array( 'enddatetime' =>  date())         ),         "limit" => 10,         "sort"  => array("_id" => -1)     )); 

i have not tested honest, think should trick:

$records = records::find(array(     'conditions' => array(         'enddatetime' => array(             '$lte' => new mongodate(strtotime("now"))         ),     ),     'limit' => 10,     'sort'  => array(         '_id' => -1     ) )); 

Comments