There is an user model and an account model. An user can have many accounts. Approximately an user has 5 accounts.
What kind of associations should I use in this case: EmbeddedDocument or one-to-many?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Could an account exist without a user? Could you have more than 1 user with the same account?
It seems it doesn’t so perhaps it is betther to embed the accounts into the User.
Review the Mongo documentation about embedding vs linking