Links: "Only top-level fields are fully supported for now." #506
egmontmayer
started this conversation in
General
Replies: 1 comment
-
Without the Pydantic Base model in between it works. When using .find_all(fetch_links=False).to_list() I can see all of my linked Documents as expected, I can see 4 Items in the List:
But when using .find_all(fetch_links=True).to_list() Beanie seems to do some optimization, it shows the individual document only once, even though the document is linked in the list 4 times. Only one item in the List:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to express a table in a single document. I was thinking of a list of n columns containing a list of n rows. The Table would be a Beanie Document, each column would be of Pydantic BaseModel with a field called "rows" of the type List[Link[Document]]
I have been playing around with it and creating the initial document works fine, but somehow Beanie creates an embeded a copy of the linked document in the database. And when using find_all(fetch_links=True) Beanie does not use the ObjectId to lookup the most recent data of the Linked Document, but actually seves the stale data that was embedded during the time of creation. Am I missing something? I updated to 1.18.0b1 and using MongoCE 4.4.15
The Documentation says "Only top-level fields are fully supported for now." Does this mean an application like I had in mind does not work yet?
Any suggestions are welcome!
Beta Was this translation helpful? Give feedback.
All reactions