纵有疾风起
人生不言弃

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)[]

未经允许不得转载:起风网 » The ‘cursor’ option is required, except for aggregate with the explain argument
分享到: 生成海报

评论 抢沙发

评论前必须登录!

立即登录