yiisoft / yii2-mongodb

Yii 2 MongoDB extension
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
326 stars 191 forks source link

MongoDB extension 1.20 deprecation issue #379

Closed Stevad closed 2 days ago

Stevad commented 5 days ago

What steps will reproduce the problem?

Use fresh MongoDB PECL extension v1.20+

What's expected?

Any query operation without deprecation issues.

What do you get instead?

MongoDB\Driver\Cursor::getId(): The method "MongoDB\Driver\Cursor::getId" will no longer return a 
"MongoDB\Driver\CursorId" instance in the future. Pass "true" as argument to change to the new behavior and
receive a "MongoDB\BSON\Int64" instance instead. {"exception":"[object] (yii\\base\\ErrorException(code: 
8192): MongoDB\\Driver\\Cursor::getId(): The method \"MongoDB\\Driver\\Cursor::getId\" will no longer return
a \"MongoDB\\Driver\\CursorId\" instance in the future. Pass \"true\" as argument to change to the new
behavior and receive a \"MongoDB\\BSON\\Int64\" instance instead. at /var/www/html/vendor/yiisoft/yii2-
mongodb/src/Query.php:215)

Additional info

Q A
Yii version 2.0.50
Yii MongoDB version 3.0.1
MongoDB server version 5.0.28
PHP version 8.1.30
Operating system Ubuntu 22.04

On MongoDB PECL extension versions prior to the 1.20 issue do not appear.