-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[4.0.0] Relation exists query fails always #2064
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
The maintainers have removed relationships in version 4 |
Hi @hylke94 |
@Christophvh embedded relationships eloquent magic has been removed only. This is a bit different completely. -- @hylke94 we have tests for that type of relationship. Have you checked that? Minimal reproduction repo might help as well. |
@divine No, i do not run the tests from third party packages.. May I suggest to at least throw an exception for relation function that are not (going to) working anymore? I already did not use the Mongo relations for their bad support, but this one worked fine in previous versions. So, to be honest, if this default Eloquent function is not going to work anymore with Laravel 7, please overwrite the function to throw an exception. |
We have postponed version 4 release while at the same there will be new release for L7 support. Thanks! Closing as it's being resolved. |
When will you release if I may ask? I don't see any update in code here... How is it all of a sudden resolved then? What has changed or is fixed? Can we test this somehow? Maybe with a new alpha release? |
It could be me, but I don't see the new releases... To confirm.. We should go back a version (from 4.0-alpha to 3.7) to get our Laravel 7 support now? And for the Laravel 8 support, we need which version? |
Correct. For L7 - 3.7 and L8 - 3.8. Version 4 will be postponed for L9 probably but no plans for now. Draft release is ready and will be released shortly. Thanks! |
@divine two weeks later... And still waiting for a Laravel 8 release... |
@hylke94 I'm really sorry but we don't have enough permissions to merge this PR #2108 (comment) Thanks! |
Description:
The exists function on a relation always fails with a query run in MongoDB.
For MySQL, Laravel performs an exists function on the database and returns this results with an 'exists' alias. For the same query in mongodb (the exists query compile function is overwritten by this package), it applies the filters (for the foreign key), adds a limit of 1 record and returns that.
The exists query isn't overwritten in de mongo base model of this package, so it is handled by the Laravel base model en checks for the exists column. This column doesn't exists, so it falls back to returning
false
(see Illuminate\Database\Query\Builder::exists()).Steps to reproduce
Expected behaviour
Telling me if there are records found.
Actual behaviour
It falls back to always telling no.
Logs:
MySQL exists query:
MongoDB exists query:
Also the mongodb queries doesn't support parameter binding? I see now the ID is put in the query immediately..
The text was updated successfully, but these errors were encountered: