Open elgrosboub opened 4 months ago
Hello @elgrosboub, thanks for bringing us this report about the issue; we will check about this change on the last version of MongoDB package and fix it.
I will ask the wise @pxpm to check this compatibility.
Cheers.
Bug report
Installed a fresh Laravel 10+ Last Backpack V6 + Last MongoDB Package (https://www.mongodb.com/compatibility/mongodb-laravel-integration)
What I expected to happen
Work.
What happened
When I change connection :
use MongoDB\Laravel\Eloquent\Model; protected $connection = 'mongodb';
I have error :
This method is not supported by MongoDB. Try "toMql()" instead. {"userId":1,"exception":"[object] (BadMethodCallException(code: 0): This method is not supported by MongoDB. Try \"toMql()\" instead. at //vendor/mongodb/laravel-mongodb/src/Query/Builder.php:1442) [stacktrace] #0 //vendor/backpack/crud/src/app/Library/CrudPanel/Traits/Query.php(220): MongoDB\Laravel\Query\Builder->toSql()
What I've already tried to fix it
When i change by ->toMql() instead >toSql() that work !
Is it a bug in the latest version of Backpack?
Yes