MongoDB TTL does not work on atlas but works fine on localhost

Hi @Mithil_Poojary,

Oh is that so? Because this is what I was doing. I will retry this time by pasting inside options .

I see the confusion, the last posted image is also not properly defined.

Ok you need to place field name under FIELDS:

{ "expiresAt": 1 }

And under OPTIONS:

 { expireAfterSeconds: 0 }

If you look on the createIndex command you will see that there are 2 separate documents to place parameters. The UI mimic this structure therefore all fields specs are under FIELDS and any option is under OPTIONS.

Thanks,
Pavel

4 Likes