use mongo auto expire feature to delete some filtered documents from a collection

83 Views Asked by At

I have a collection named "feed"

Each document has keys called "status" and "scheduleDate" in it.

I want to set a ttl based index on scheduleDate key, but only those documents should get deleted which have

status:{$in:["invalid", "cancelled"]}

Is there a way to do it?

0

There are 0 best solutions below