mongoose current date and timestamp code example
Example 1: mongoose timestamps
const userSchema = mongoose.Schema({
email: String
}, { timestamps: true });
Example 2: timestamps in mongoose
const userSchema = mongoose.Schema(
{
email: String,
},
{ timestamps: true }
);