I would like to code a web application in which most sections depend on the user profile (for example, different to-do lists per person, etc.), and I would like to use MongoDB. I was thinking of creating about 10 embedded documents for the main profile document and saving everything that is connected with one user inside his own document.
I don’t see a clear way to use foreign keys for mongodb, the only way would be to create a to_do_id field with the ObjectId type, for example, but they would not be completely interconnected, it would just happen to have the same Identifiers, which I would have to request.
- Is there a limit on the number of built-in document types within a top-level document, which can degrade performance?
- How do you solve the problem with a central profile document that most documents have to deal with when presenting a presentation to a person?
- Do you use semi-interval keys inside MongoDb and have fields with ObjectId types that will have some other unique identifier for the document, and not embed them?
I can’t understand what approach should be taken when. Thank you very much!
source share