mongodb / laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)
https://www.mongodb.com/compatibility/mongodb-laravel-integration
MIT License
6.96k stars 1.42k forks source link

withCount is not working #3003

Open Rahul-codoffer opened 3 weeks ago

Rahul-codoffer commented 3 weeks ago

Description:

Getting This method is not supported by MongoDB. Try \"toMql()\" instead on withCount function

omerkoseoglu commented 3 weeks ago

+1

Rahul-codoffer commented 2 weeks ago

@omerkoseoglu ?

GromNaN commented 2 weeks ago

Could you please provide a sample code to reproduce the issue. Some features are not supported with MongoDB or require some additional work.

hooman-mirghasemi commented 6 days ago

I have same problem in laravel 10 php 8.3 and this package latest version 4.5

GromNaN commented 6 days ago

@hooman-mirghasemi Same question.

Could you please provide a sample code to reproduce the issue. Some features are not supported with MongoDB or require some additional work.

hooman-mirghasemi commented 1 day ago

make a model in mysql "post" then make an other one in mongo db "comments" make hybrid relationships

Post::withCount('comments')->get();