C# Driver TTL at specific time


Me and my friend Google have for hours now looked into TTL. I am searching for a way to have individual documents to be be removed on their own specific ExpireAt.

I have read this https://docs.mongodb.com/manual/tutorial/expire-data/#expire-documents-at-a-specific-clock-time and I can’t seem to find any examples that for me work.

I create my index like this if index not exist:

var indexModel = new CreateIndexModel<MyEntity>(
keys: Builders<MyEntity>.IndexKeys.Ascending("ExpireAt"),
options: new CreateIndexOptions
  ExpireAfter = TimeSpan.FromSeconds(0),
  Name = "ExpireAtIndex"


Setting it to zero seems to be the correct way if I haven’t totally misunderstood something?

Document modell MyEntity (dates are in UTC):

public class MyEntity
  public ObjectId Id { get; set; }

  public string TestProp { get; set; }

  public DateTime ServiceDate { get; set; } // this is the value the index should consider

  public DateTime CreatedAt { get; set; }

  public DateTime ExpireAt { get; set; } // ServiceDate + adding 120 seconds 

I see the index being created in MongoDB Compass Client and a document being created when I insert one.

var entity = new MyEntity()
  ServiceDate = servicedate,
  TestProp = testprop,
  CreatedAt = createdAt,
  ExpireAt = serviceDate.AddSeconds(120)

var updateResult = await _collection.ReplaceOneAsync(
  f => f.TestProp == entity.TestProp,
  new ReplaceOptions { IsUpsert = true });

What happens in the Compass client is that the inserted document is removed way before 120 seconds. Could someone please share some light or put me in the right direction on how to achieve so I can have the behaviour that a document is removed 120 seconds after its actual ServiceDate? Or have I misunderstood TTL altogether?