我想检索结束日期小于"今天"的记录。下面是我得到的,但不工作。如有任何建议,不胜感激。
$records = Records::find(array(
'$lte' => array(
array( 'endDateTime' => date())
),
"limit" => 10,
"sort" => array("_id" => -1)
));
我还没有测试过,但我认为这应该是可行的:
$records = Records::find(array(
'conditions' => array(
'endDateTime' => array(
'$lte' => new Mongodate(strtotime("now"))
),
),
'limit' => 10,
'sort' => array(
'_id' => -1
)
));