I set a document to expire at exactly 2022-09-10T01:42:00.000+00:00
But the document doesn't get deleted immediately, several seconds passed by before it eventually gets deleted.
Is there a way to make expireAt fire immediately the time is reached? It shouldn't wait for an extra second at all?
This is the structure of my schema
const EventSchema = new mongoose.Schema(
{
_id: mongoose.Schema.Types.ObjectId,
expireAt: { type: Date, expires: 0 }
},
{ timestamps: true }
);
EventSchema.index({ "expireAt": 1 }, { expireAfterSeconds: 0 })
My use case is mongoose.
Thanks