title: Mongoose subdocuments vs nested schema
body: <p>I'm curious as to the pros and cons of using subdocuments vs a deeper layer in my main schema:</p>
  
  <pre><code>var subDoc = new Schema({
    name: String
  });
  
  var mainDoc = new Schema({
    names: [subDoc]
  });
  </code></pre>
  
  <p>or </p>
  
  <pre><code>var mainDoc = new Schema({
    names: [{
      name: String
   }]
  });
  </code></pre>
  
  <p>I'm currently using subdocs everywhere but I am wondering primarily about performance or querying issues I might encounter.</p>