-
Notifications
You must be signed in to change notification settings - Fork 217
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
[BUG] wrong condition convertion on comparing two fields #959
Comments
This issue is stale because it has been open 30 days with no activity. |
This issue was closed because it has been stalled for 14 days with no activity. |
Hi @Karmenzind, Doing Now, if you do for example results = await H.find(H.last_sms_time < datetime.now()).to_list() You would get back the results (and proving that the generated query is correct):
So the Find interface is stable, it simply does not behave the way you expected it would. |
Thanks for your reply. @staticxterm
No that's not what I want. The requirement here is to compare two dynamically changing fields, other than a fixed value. Because each document has its own |
Okay, thank you for the reply. I now understand your use case a bit better. |
Describe the bug
I need to compare two fields with
model.field1 > model.field2
but Beanio generated the wrong filter.My model is like:
And
H.find(H.next_sms_time < H.last_sms_time).get_filter_query()
returned{'next_sms_time': {'$lt': 'last_sms_time'}}
that comparesnext_sms_time
with literal string 'last_sms_time'.But the correct filter that will be recognized by Mongodb should be:
or with
$where
:To Reproduce
Sorry I will complete the sample later.
Expected behavior
See above.
Additional context
Nothing.
The text was updated successfully, but these errors were encountered: