CodeIgniter Forums
How use where for time format in MongoDB - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: General (https://forum.codeigniter.com/forum-1.html)
+--- Forum: Lounge (https://forum.codeigniter.com/forum-3.html)
+--- Thread: How use where for time format in MongoDB (/thread-74493.html)



How use where for time format in MongoDB - omid_student - 10-01-2019

Hi
I know my question not is about Codeigniter
But here is only i have my friends

So go to problem

I have many records that contain document {"id":"123123","date":"2019/2/2","time":"125123213"}
time value is timestamp

I can use range condition for date example between 2019/1/1 and 2019/1/20
But i cannot use range condition for time example 20:30 and 21:30

Do you help me?

Note:
my code where date condition is
PHP Code:
$searchCriteria =array('date' => array('$gte' => $date'$lte' => $to_date));
$this->mongo_db->where($searchCriteria); 

Thanks