-
-
Notifications
You must be signed in to change notification settings - Fork 502
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
OperatorMap type doesn't include $exists #3295
Comments
It was never there. In v4 it was just not strictly type checked.
This is a TS error, you can just cast I dont mind adding it there, as long as we will have meaningful error handling for SQL drivers where this wont work (or maybe we should just contert that for SQL drivers to SQL alternative, maybe to |
Right, that makes sense. My team tries to avoid
If I understood correctly, you are suggesting offering an equivalent
Matching MongoDB's exists, we can return all fields which are not equal to |
In SQL there is no undefined value, the value of nullable column is always null even if you did not provide it. That's why I said |
Oh, I did not know that. In that case, what you said is perfect. Should I provide a PR for the same? |
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
I have a
deletedAt
field in my entities. I'm trying to fetch the entities where thedeletedAt
field does not exist.Here's what my query looks like:
After MikroORM v5, I can't use this anymore.
It would be nice to have
$exists
option. Since it would check for bothundefined
andnull
at the same time. Also, there might be several other projects using$exists
option, which will break. Having the$exists
option will make v5 more backwards compatible with v4.Describe the solution you'd like
A clear and concise description of what you want to happen.
Update the types of
OperatorMap<T>
to include$exists
as well.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
I find this a little wobbly, because it won't match
deletedAt
being set tonull
.Additional context
Add any other context about the feature request here.
I'd be happy to open a PR if you think this is worth adding.
The text was updated successfully, but these errors were encountered: