title: How to create MongoDB TTL Index for DatetimeOffset stored as an array [ticks,offset]?
body: <p>I am trying to create MongoDB TTL indexe on a collection that contains documents with DateTimeOffset. But the date is persisted as an array of ticks and offset as such [ticks, offset]. 
  For example :</p>
  
  <pre><code>TimeStamp:Array [
      0:636803424000000000, 
      1:-360]
  </code></pre>
  
  <p>My model looks like the following: </p>
  
  <pre><code>public class Log
  {
      ....
      DateTimeOffset? TimeStamp{get; set;}
  }
  </code></pre>
  
  <p>I am using MongoDb.Driver v2.7.2 and I have been trying to create index in such a way </p>
  
  <pre><code>....
  var indexKeysDefinition = Builders&lt;Log&gt;.IndexKeys.Descending(l =&gt; l.TimeStamp);
  var indexOptions = new CreateIndexOptions 
  { 
      ExpireAfter = TimeSpan..FromTicks(TimeSpan.TicksPerMinute), 
      Name = "LogsTimeStamPIndex", 
      Background = true 
  };
  var model = new CreateIndexModel&lt;Log&gt;(indexKeysDefinition, indexOptions);
  await _database.GetCollection&lt;Log&gt;("Log").Indexes.CreateOneAsync(model);
  ....
  </code></pre>
  
  <p>This is creating the index but documents are not expiring after 1 minute. How do I go about creating TTL for DateTimeOffset stored in such a way ? or What am I missing here ?</p>