-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[Proposal] $query->whereFieldExists #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I could just overwrite the |
Yes, it means something different (http://dev.mysql.com/doc/refman/4.1/en/exists-and-not-exists-subqueries.html) and a method already exists. We can't override it because the first argument has to be a |
And I guess |
In fact, In a more general discussion, what do you think about writing custom methods for specific MongoDB operators ( |
I will take a look at it, should not be that hard I guess. |
Ok, ask if you need help. |
Great ! |
How to solve this |
--! help |
Sometimes, I have to use this syntax :
It could be better if it was :
But a
whereExists()
method already exists in Laravel. It corresponds to theWHERE EXISTS
SQL operator, wich have no sens in the MongodDB context, am I right ? It could be good to overwrite the initial method with an other one, matching the$exists
MongoDB operator like in the case above but it's impossible because the arguments are not the same (the initial method need a Closure as first argument).We could have a
whereFieldExists()
method with an implementation like that :After tests and writing this I'm not completely sure that this syntax is really great... What do you think about ? this question is more general because we could have also
whereType
orwhereAll
. I could work on this in the next days.The text was updated successfully, but these errors were encountered: