title: How often does MongoDB check its index 'expireAfterSeconds'?
body: <p>I use a single instance MongoDB locally and in a Spring Boot Repository, I annotate a document-class with this annotation:</p>
  
  <pre><code>@Indexed(name = "deleteAt", expireAfterSeconds = 0)
  private LocalDateTime deleteAt;
  </code></pre>
  
  <p>As I read from the docs <a href="https://docs.mongodb.com/manual/tutorial/expire-data/" rel="noreferrer">here</a>, documents should automatically get deleted at the specified <code>DateTime</code>. It works mostly but I see a delay in deletion when I poll the same document frequently. Most documents were deleted immediately, yet some remain in the DB for up to 30 seconds after the specified deletion time. </p>
  
  <p>That makes me wonder whether MongoDB runs a scheduler to clean up such documents and if so, how often does it run? </p>