Skip to content

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

Closed
@darkmatter18

Description

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']}}

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions