'Mongoose document expires too quickly
I want to have my articles deleted after an hour, as you can see from the code, but they are being deleted after about 2 minutes
import mongoose from 'mongoose';
var articleSchema = new mongoose.Schema({
title: String,
text: String,
link: String,
description: String,
imgLink: String,
source: String,
} , { timestamps: true }
);
articleSchema.index({ createdAt: 1 }, { expires: '60m' });
var Article = mongoose.model("Article", articleSchema);
export default Article;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
