We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug query with fetch_links=True does not recoginize criteria including link's ref id when it is parenthesized in an Or operator.
To Reproduce
import asyncio from beanie import Document, Link, init_beanie, PydanticObjectId from beanie.operators import Or class Directory(Document): name: str class File(Document): name: str size: int directory: Link[Directory] async def main(): await init_beanie(connection_string="mongodb://localhost:27017/test", document_models=[Directory, File]) directory = await Directory(name="dir-2").insert() await File(name="file-2", size=5, directory=directory).insert() files = await File.find(Or(File.size > 10, File.directory.id == directory.id), fetch_links=True).to_list() # does not find any files print(files) files = await File.find(File.directory.id == directory.id, fetch_links=True).to_list() # produces correct files print(files) asyncio.run(main())
Expected behavior Or criteria can be rendered correctly
Additional context beanie version = 1.20.0 MongoDB version = 6.0.6
The text was updated successfully, but these errors were encountered:
This issue is stale because it has been open 30 days with no activity.
Sorry, something went wrong.
This bug still exists in 1.21.0
This issue was closed because it has been stalled for 14 days with no activity.
fix: issue #631 (#734)
57dd7e7
* fix: convert link field id within operators * fix lint & mypy type error --------- Co-authored-by: IterableTrucks <IterableTrucks@localhost>
No branches or pull requests
Describe the bug
query with fetch_links=True does not recoginize criteria including link's ref id when it is parenthesized in an Or operator.
To Reproduce
Expected behavior
Or criteria can be rendered correctly
Additional context
beanie version = 1.20.0 MongoDB version = 6.0.6
The text was updated successfully, but these errors were encountered: