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

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

برای حل مشکل باید  متد aggregate()   را در کلاس Command   ویرایش کنید.


app\vendor\yiisoft\yii2-mongodb\Command.php

public function aggregate($collectionName, $pipelines, $options = []) {

if (empty($options['cursor'])) {
$returnCursor = false;
$options['cursor'] = new \stdClass();
} else {
$returnCursor = true;
}
$this->document = $this->db->getQueryBuilder()->aggregate($collectionName, $pipelines, $options);
$cursor = $this->execute();
if ($returnCursor) {
return $cursor;
}
return $cursor->toArray();

}

 

منبع:

 

 

 

دیدگاهتان را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *