MongoDB ExpireAfterSeconds always expires after 60 seconds.
Unanswered
Kromfohrländer posted this in #help-forum
KromfohrländerOP
My code:
export type Job = {
jobDate: Date;
};
const JobSchema = new Schema(
{
jobDate: { type: Date, required: true },
}
);
JobSchema.index({ jobDate: 1 }, { expireAfterSeconds: 600000 }); // 7 days in seconds
I've done all the basics. Anyone know whats up?
export type Job = {
jobDate: Date;
};
const JobSchema = new Schema(
{
jobDate: { type: Date, required: true },
}
);
JobSchema.index({ jobDate: 1 }, { expireAfterSeconds: 600000 }); // 7 days in seconds
I've done all the basics. Anyone know whats up?
2 Replies
Komondor
did you restart your nextjs server after changing it to 600000 ?
Komondor
or if you previously created that index with a different value for expireAfterSeconds, perhaps you need to delete that index so it will get recreated with the new 600000 value