When to use subdocuments in MongoDB? -
i'm mysql background, , might misunderstanding uses of mongo's subdocs.
i have bunch of users can write , publish articles. these articles ever seen user.
should these articles stored references users or in userschema:
articles: [articleschema]
mongodb essence allows replace join subdocuments. keep in mind there no native join in mongodb in sql world. depending on query structure, may either embed users in articles or articles in users.
Comments
Post a Comment