You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using fetch_links=True with a View results in an error:
...
File ".../beanie/odm/queries/find.py", line 1042, in __await__
document = yield from self._find_one().__await__() # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../beanie/odm/queries/find.py", line 998, in _find_one
return await self.document_model.find_many(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../beanie/odm/queries/find.py", line 701, in first_or_none
res = await self.limit(1).to_list()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../beanie/odm/queries/cursor.py", line 72, in to_list
cursor = self.motor_cursor
^^^^^^^^^^^^^^^^^
File ".../beanie/odm/queries/find.py", line 674, in motor_cursor
] = self.build_aggregation_pipeline()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../beanie/odm/queries/find.py", line 623, in build_aggregation_pipeline
] = construct_lookup_queries(
^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../beanie/odm/utils/find.py", line 32, in construct_lookup_queries
database_major_version=cls._database_major_version,
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../pydantic/_internal/_model_construction.py", line 237, in __getattr__
raise AttributeError(item)
AttributeError: _database_major_version
+1 fetch_links=True does not fully populate the linked documents but Object { id: "668ea3dda0a3e171ae3fbd71", collection: "users" } in the linked field of the linking document.
Using
fetch_links=True
with aView
results in an error:To Reproduce
Expected behavior
View.find_one(..., fetch_links=True)
works exactly like it does forDocument
s.The text was updated successfully, but these errors were encountered: