title: MongoDb TTL on nested document is possible?
body: <p>I want to know if it's possible to use TTL on nested documents.</p>
  
  <h3>Scenario</h3>
  
  <p>I have <code>Account</code> and inside I have <code>Sessions</code>. <code>Sessions</code> need to expire in 30 minutes. I've set everything up but obviously when I set TTL index on <code>Account.Sessions.EndDateTime</code> it removes the whole <code>Account</code>. Can I make sure it removes only <code>Session</code>?</p>
  
  <p>This is what it looks like in database. Notice how it will delete whole <code>Account</code> and not only <code>Session</code> when <code>EndDateTime</code> will come.</p>
  
  <pre><code>{
      "_id" : ObjectId("53af273888dba003f429540b"),
      "Email" : "steve@s3te5ve.com",
      "PasswordHash" : "CZaBEQRbwWNgJBjyhks7gH0Z3v5ZvDkW29pryF0DEXyE8rIw0NA4x39+uQneArKaUv97sP1e+e22YT1glbqQsw==",
      "PasswordSalt" : "100000.Qx4D8uj7oDcWHRTLGRRTDwVkw2UcaM52XkDR9k2ga073Ow==",
      "Sessions" : [ 
          {
              "Token" : "da55cf0783c4249b26283948fcae6caa15df320ca456203045aea81cad691df8",
              "IpAddress" : "::1",
              "StartDateTime" : ISODate("2014-06-28T20:36:27.000Z"),
              "EndDateTime" : ISODate("2014-06-28T21:06:27.000Z")
          }
      ]
  }
  </code></pre>
  
  <p>This is where I create said index.</p>
  
  <pre><code>if (!_db.Accounts.IndexExists("Sessions.EndDateTime"))
  {
      _db.Accounts.CreateIndex(IndexKeys.Ascending("Sessions.EndDateTime"),
          IndexOptions.SetTimeToLive(new TimeSpan(0)));
  }
  </code></pre>