title: Document in MongoRepository not deleted with 'expireAfterSeconds'
body: <p>I would like my <code>MongoRepository</code> in Spring Boot to automatically delete documents at a certain point in time after creation. Therefore I created the following class:</p>
  
  <pre><code>import org.springframework.data.annotation.Id;
  import org.springframework.data.mongodb.core.index.Indexed;
  
  public class MyDocument {
      @Id
      private String id;
      @Indexed
      private String name;
      @Indexed(expireAfterSeconds = 0)
      private LocalDateTime deleteAt;
  }
  </code></pre>
  
  <p>Then, I save it in the Spring Boot <code>MongoRepository</code>: </p>
  
  <pre><code>MyDocument doc = modelMapper.map(myDocumentDto, MyDocument.class);
  LocalDateTime timePoint = LocalDateTime.now();
  timePoint = timePoint.plusMinutes(1L);
  doc.setDeleteAt(timePoint);
  docRepository.save(doc);
  </code></pre>
  
  <p>I periodically query the repository and would assume that after one minute, the document will not be there anymore. Unfortunately, I get the document every time I query and it is never deleted.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>The document is persisted as follows (.toString()):</p>
  
  <pre><code>MyDocument{id='5915c65a2e9b694ac8ff8b67', name='string', deleteAt=2017-05-12T16:28:38.787}
  </code></pre>
  
  <p>Is MongoDB possibly unable to read and process the <code>LocalDateTime</code> format? I'm using org.springframework.data:spring-data-mongodb:1.10.1.RELEASE, so JSR-310 should already be supported as announced in 2015 here: <a href="https://spring.io/blog/2015/03/26/what-s-new-in-spring-data-fowler" rel="nofollow noreferrer">https://spring.io/blog/2015/03/26/what-s-new-in-spring-data-fowler</a></p>