title: MongoDB: Two-field index vs document field index
body: <p>I need to index a collection by two fields (unique index), say field1 and field2. What's better approach in terms of performance:</p>
  
  <ol>
  <li><p>Create a regular two-column index</p>
  
  <p>-or -</p></li>
  <li><p>Combine those two fields in a single document field {field1 : value, field2 : value2} and index that field?</p></li>
  </ol>
  
  <p>Note: I will always be querying by those two fields together.</p>