我有一些收藏:
$data_to_insert = array('date'=> $current_date, 'str_date' => $today_date_str, 'user_id' => intval($post->post_author), 'post_id' => $post->ID, 'user_ip' => current_user_ip());
我从 mongo 数据库中获取了一些数据(它正在工作):
$start = new MongoDate(strtotime("-14 days"));
$end = new MongoDate(strtotime(date("Y-m-d H:i:s")));
$last_day_query = $hits_collection->find(array("date" => array('$gt' => $start, '$lte' => $end), "user_id" => $current_user->ID));
我如何需要修改我的查询以获取按天分组的数据?