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

The fetch_links=True in beanie queries doesn't work #20

Open
nemrok opened this issue Oct 22, 2022 · 4 comments
Open

The fetch_links=True in beanie queries doesn't work #20

nemrok opened this issue Oct 22, 2022 · 4 comments

Comments

@nemrok
Copy link

nemrok commented Oct 22, 2022

So after getting a document calling fetch_all_links() works however when using the keyword argument it doesn't. Thus you can't do queries comparing the linked document properties. For example the below would not work:

doc = await House.find_one(House.front_door.color == 'Blue', fetch_links=True)

@michaelkryukov
Copy link
Owner

michaelkryukov commented Oct 23, 2022

This looks like same issue with mongomock's implementation of DBRef (which is the core of beanie's links) as discussed in #5. I've created issue at mongomock (mongomock/mongomock#759), but I don't really want to patch internals of mongomock in this library. So currently support for links is limited.

@nemrok
Copy link
Author

nemrok commented Oct 24, 2022

Thanks so much! In the interim, I changed my code to use fetch_all_links in an async for loop and for cases where I need to use fetch_links I skipped these unit tests for now. I have integration tests to cover these cases. However it would be great to have this working.

@mahdian888
Copy link

Hello, Can you fix this?
it shows NotImplementedError: Although 'pipeline' is a valid lookup operator for the aggregation pipeline, it is currently not implemented in Mongomock.

@michaelkryukov
Copy link
Owner

What exactly is not working for you? This issue refers to the internal implemetation of beanie that doesn't support some operations with DBRef that mongo supports (and beanie uses).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants