You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
yii\base\ErrorException: Undefined index: result in .../vendor/yiisoft/yii2-mongodb/Command.php:734
Additional info
When aggregating with a large number of documents, mongodb produces an error "exception: aggregation result exceeds maximum document size (16MB)". In the mongodb manual, it is recommended that you use a cursor or temporary collection.
As I understand, yii2-mongodb uses a query variant, in which all results are returned as a single document. If this document large enough, mongodb will fail with BSON limit. When setting the 'cursor' option, mongodb returns the documents as an array (cursor). The element 'result' is missing in the results
I propose to enable the 'cursor' option by default and treat the result as a cursor.
Q
A
Yii version
2.0.12
Yii MongoDB version
2.1.4
MongoDB server version
v3.4.8-rc1
PHP version
7.1.1
Operating system
Linux Mint
The text was updated successfully, but these errors were encountered:
kalyashka
changed the title
Aggregation problem with cursor option
Aggregation problem with 'cursor' option
Sep 6, 2017
What steps will reproduce the problem?
$collection->aggregate($pipeline, ['cursor' => ['batchSize' => 100]]);
What's expected?
Aggregation result
What do you get instead?
yii\base\ErrorException: Undefined index: result in .../vendor/yiisoft/yii2-mongodb/Command.php:734
Additional info
When aggregating with a large number of documents, mongodb produces an error "exception: aggregation result exceeds maximum document size (16MB)". In the mongodb manual, it is recommended that you use a cursor or temporary collection.
As I understand, yii2-mongodb uses a query variant, in which all results are returned as a single document. If this document large enough, mongodb will fail with BSON limit. When setting the 'cursor' option, mongodb returns the documents as an array (cursor). The element 'result' is missing in the results
I propose to enable the 'cursor' option by default and treat the result as a cursor.
The text was updated successfully, but these errors were encountered: