4
我在mongodb中保存了一个像这样的字符串,如tdate:"2016-11-26 2:23:11"
。我想要计算所有这个日期为2016-11-26
的对象。 这就是我正在尝试使用php
但没有运气。同时,我想通过day
所有对象应该具有这种格式"Y-m-d"
如何在mongodb和php中计算特定日期的对象
function count_auth($tdate) {
$collection = 'mycollection';
return $this->db->{$collection}->count(array('date_authenticated' => $tdate));
}
有用的答案我可以使用这个'$ startsWithRegex ='/^'.$ tdate。'/';'? – Muya
是的,这应该是可能的 – P0rnflake