Replies: 2 comments 1 reply
-
@roman-right Can you take a look for me? Thank you |
Beta Was this translation helpful? Give feedback.
0 replies
-
@vasttian Hi! If you have the document class, you can init it at any moment in runtime using init_beanie. If you have a specific usecase where you can not use it, please explain it for me - I'll think how to support it |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Can beanie support dynamically creating a document and dynamically registering a document after init_beanie?
Because I may have many documents, I want to register it when I need to use a certain document (similar to: document_models in init_beanie).
I might not be able to define the model in advance. Because the collection name is indeterminate(Or can beanie support defining a template model in advance? Then modify the name of the collection when creating a new one).
Example:
A product has many projects. I need to automatically create a collection named project name in MongoDB to store the data of the current project every time I create a new project. Then initialize this collection to perform some database operations when you need to edit the project.
Thx.
Beta Was this translation helpful? Give feedback.
All reactions