title: How can I dynamically ensureIndex on a mongoose schema
body: <p>I have a data field in my schema that is of mixed payload type</p>
  
  <pre><code>data : {
    type : Schema.Types.Mixed
  }
  </code></pre>
  
  <p>the mixed payload will be in the form of</p>
  
  <pre><code>"attributes" : {
              "type" : "Lead",
          },
  "Email" : "test1400159913304@example1400159913304.com",
  "Name" : "Test1400159913304",
  "Id" : "00Qi000000OIFVeEAP"
      }
  </code></pre>
  
  <p>The payload will obviously change but I want to be able to dynamically set indexes on certain keys. 
  i.e everything except attributes and Id</p>
  
  <p>I will have a handle on the keys that need to be indexed.</p>
  
  <p>Is there a way to dynamically index keys using either mongoose or mongo as I save the documents? </p>