Closed Vatsal-Innovatemr closed 3 years ago
Do you mean that the aggregation pipeline does not work?
Thanks for posting in our issue tracker. In order to properly assist you, we need additional information:
Thanks!
This is an automated comment, triggered by adding the label status:need more info
.
Do you mean that the aggregation pipeline does not work?
I am using find() as below, $query = User::find(); $query->select(['id','_id','email','status']); $query->group('email');
Gives me the below error, { "name": "Exception", "message": "Calling unknown method: yii\mongodb\ActiveQuery::group()", "code": 0, "type": "yii\base\UnknownMethodException", "file": "C:\xampp\htdocs\panels\vendor\yiisoft\yii2\base\Component.php", "line": 301, "stack-trace": [ "#0 C:\xampp\htdocs\panels\common\models\panelist\PanelistGetCountV5.php(263): yii\base\Component->__call('group', Array)", "#1 C:\xampp\htdocs\panels\api\modules\v1\controllers\PanelistController.php(1664): common\models\panelist\PanelistGetCountV5->searchQualified(Array)", "#2 [internal function]: api\modules\v1\controllers\PanelistController->actionGetCount()", "#3 C:\xampp\htdocs\panels\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)", "#4 C:\xampp\htdocs\panels\vendor\yiisoft\yii2\base\Controller.php(181): yii\base\InlineAction->runWithParams(Array)", "#5 C:\xampp\htdocs\panels\vendor\yiisoft\yii2\base\Module.php(534): yii\base\Controller->runAction('get-count', Array)", "#6 C:\xampp\htdocs\panels\vendor\yiisoft\yii2\web\Application.php(104): yii\base\Module->runAction('v1/panelist/get...', Array)", "#7 C:\xampp\htdocs\panels\vendor\yiisoft\yii2\base\Application.php(392): yii\web\Application->handleRequest(Object(yii\web\Request))", "#8 C:\xampp\htdocs\panels\api\web\index.php(49): yii\base\Application->run()", "#9 {main}" ] }
Same for groupBy as well, { "name": "Exception", "message": "Calling unknown method: yii\mongodb\ActiveQuery::groupBy()", "code": 0, "type": "yii\base\UnknownMethodException", "file": "C:\xampp\htdocs\panels\vendor\yiisoft\yii2\base\Component.php", "line": 301, "stack-trace": [ "#0 C:\xampp\htdocs\panels\common\models\panelist\PanelistGetCountV5.php(263): yii\base\Component->__call('groupBy', Array)", "#1 C:\xampp\htdocs\panels\api\modules\v1\controllers\PanelistController.php(1664): common\models\panelist\PanelistGetCountV5->searchQualified(Array)", "#2 [internal function]: api\modules\v1\controllers\PanelistController->actionGetCount()", "#3 C:\xampp\htdocs\panels\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)", "#4 C:\xampp\htdocs\panels\vendor\yiisoft\yii2\base\Controller.php(181): yii\base\InlineAction->runWithParams(Array)", "#5 C:\xampp\htdocs\panels\vendor\yiisoft\yii2\base\Module.php(534): yii\base\Controller->runAction('get-count', Array)", "#6 C:\xampp\htdocs\panels\vendor\yiisoft\yii2\web\Application.php(104): yii\base\Module->runAction('v1/panelist/get...', Array)", "#7 C:\xampp\htdocs\panels\vendor\yiisoft\yii2\base\Application.php(392): yii\web\Application->handleRequest(Object(yii\web\Request))", "#8 C:\xampp\htdocs\panels\api\web\index.php(49): yii\base\Application->run()", "#9 {main}" ] }
Thanks for posting in our issue tracker. In order to properly assist you, we need additional information:
- When does the issue occur?
- What do you see?
- What was the expected result?
- Can you supply us with a stacktrace? (optional)
- Do you have exact code to reproduce it? Maybe a PHPUnit tests that fails? (optional)
Thanks!
This is an automated comment, triggered by adding the label
status:need more info
.
Provided information here https://github.com/yiisoft/yii2-mongodb/issues/335#issuecomment-858664286
There is no group()
method in MongoDB Yii package. You must use the aggregation methods like in the linked documentation.
There is no
group()
method in MongoDB Yii package. You must use the aggregation methods like in the linked documentation. Yes, I know the alternate. But is there any scope of improvement to add these features?
Not that I know of.
Not that I know of.
Okay 👍
I am not able to use group or groupBy in active data provider using yii2-MongoDB. Can anyone help me with the same?