Skip to content
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] Query is not working is not encoded #1073

Open
darkmatter18 opened this issue Nov 26, 2024 · 2 comments
Open

[BUG] Query is not working is not encoded #1073

darkmatter18 opened this issue Nov 26, 2024 · 2 comments

Comments

@darkmatter18
Copy link

Describe the bug
If the query values are not in proper Python type, the query is not working. But the typed variable is working.

To Reproduce

await Model.find_many({'tenant': {'$in': ['f6a0e5a3-ef1c-414d-8c34-61a9c2d1828a']}})
# This is giving a None response

Expected behavior

await Model.find_many({'tenant': {'$in': [UUID('f6a0e5a3-ef1c-414d-8c34-61a9c2d1828a')]}})
# This is giving a None response           ^^^^^

In mongoengine, this was giving me proper response,

await Model.objects.find(tenant__in=['f6a0e5a3-ef1c-414d-8c34-61a9c2d1828a')])

So the expectation is to work on this query {'tenant': {'$in': ['f6a0e5a3-ef1c-414d-8c34-61a9c2d1828a']}}

@adeelsohailahmed
Copy link
Member

Could you please share your model definition and, ideally, a minimal reproducible example?

Copy link
Contributor

github-actions bot commented Jan 4, 2025

This issue is stale because it has been open 30 days with no activity.

@github-actions github-actions bot added the Stale label Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants