title: Mongodb: store all related data in one collection or abstract pieces of data from each other?
body: <p>Schema:</p>
  
  <pre><code>articles: [
    {
      _id: uid,
      owner: userId,
      title: string,
      text: text,
    }
  ],
  comments_1: [
    {
      // single comment
      articleId: uid,
      text: text,
      user: {
        name: string,
        id: uid
      }
    }
  ],
  comments_2: [
    {
      // all comments at once
      articleId: uid,
      comments: [
        {
          _id: commentId,
          text: text,
          user: {
            name: string,
            id: uid
          }
        }
      ],
    }
  ],
  </code></pre>
  
  <p>I'm a bit confused with mongodb recommendations:
  Say, i need to retrieve information for an article page. I'll need to do 2 requests, first to find article by id, and the second to find comments. If i'd include comments (<code>comments_2</code>) as property into each article, i'd need to perform only one query to get all the data i need, and if i'd need to list say, titles of 20 articles, i'd perform a query with specified properties to be retrieved, right?</p>
  
  <ol>
  <li>Should i store comments and articles in different collections?</li>
  <li>If comments will be in different store, should i store comments the <code>comments_1</code> way or <code>comments_2</code> way?</li>
  </ol>
  
  <p>I'll avoid deep explanations, because the schema explains my point clearly, i guess. Briefly, i don't get if it's better to store everything in one place and then specify properties i want to retrieve while querying, or abstract pieces of data to different collections?</p>