Answer the question
In order to leave comments, you need to log in
Why is the date cached when saving a record in MongoDB?
When registering a user, in the mongoose schema I increase the date by 7 days.
Here is an example:
{
reset: { type: Date, default: increaseDate(7);}
}
function increaseDate(n) {
return new Date(new Date().setDate(new Date().getDate()+n));
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question