站点图标 起风网

The ‘cursor’ option is required, except for aggregate with the explain argument

$mon->selectCollection(MON_USER_CHAT);
$query = [
‘aggregate’ => MON_USER_CHAT,
‘pipeline’ => [
[
‘$sort’=>[
‘ctime’=>-1
]
],
[
‘$match’ => [
‘uid’=>(int)$userInfo[‘id’],
// “ctime” => [‘$gte’ =>strtotime(date(‘Y-m-d’,$time))],
// “chat_type”=>29,
‘receive_uid’=>[‘$in’=>$to_uids]
]
],
[
‘$group’ => [
‘_id’ => ‘$receive_uid’,
// ‘ctime’ => ‘ctime’,
// ‘audio_time’=>’$audio_time’
// ‘total’ => [‘$sum’=>1]
‘ctime’=>[‘$first’=>’$ctime’],
‘ctime’=>[‘$first’=>’$ctime’]
]
],

],
‘allowDiskUse’ => false,
‘cursor’ => (object)[]
];

$lastmsg = $mon->query($query);

加这句:’cursor’ => (object)[]

退出移动版