-
Notifications
You must be signed in to change notification settings - Fork 215
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] search criteria not using pydantic Field alias to set the key. #937
Comments
This issue is stale because it has been open 30 days with no activity. |
anyone can help with this issue? |
I'm hitting the same issue. Pydantic aliases work for the first level object variable but none of the children. For example, if my aliases are converting between snake-case and camel-case, it only uses the alias on the first level.
Result: |
Is this a problem related to pydantic or beanie? If this is a known issue, i think it is better write it down in the document |
This is not a problem with pydantic. I use pydantic extensively with other python projects using complex nested structures. Child names are correctly formatted to their name alias rules in serialization/deserialization. This only appears to be a problem with how Beanie is translating multi-level structures to mongo specific queries. It doesn't seem to honor the field aliases for 2nd level and down, only root level names. |
This issue is stale because it has been open 30 days with no activity. |
Not stale. This is still an issue. |
looks like bug in beanie |
Describe the bug
search criteria not using pydantic alias to set the key.
To Reproduce
log here:
Expected behavior
expecting search criteria like {"vehicle_info.unitClass": "xxx"}
Additional context
None
The text was updated successfully, but these errors were encountered: