Closed mhdzumair closed 9 months ago
Hi! Thank you for the catch. I'll check and fix it this/next week.
Hi @mhdzumair , Sorry for late response. Beanie support only top-level links currently.
This issue is stale because it has been open 30 days with no activity.
You can close this story.
Describe the bug When using the
Link
field inside nestedBaseModels
and trying to insert the parentDocument
, Beanie does not save the linked document in its own separate collection as expected. Instead, it treats the linked document as an embedded document inside the parentDocument
, saving it directly within the parent document's collection.To Reproduce
Expected behavior The
Streams
document should be stored in its ownstreams
collection. TheSeries
document should only have a reference/link to theStreams
document.Current behavior The
Streams
data is embedded within the Series collection instead of being referenced from its ownstreams
collection.Additional context This issue arises particularly when using nested
BaseModel
structures and trying to store linked documents from within these nested structures.