timestamp in mongoose schema 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 }
);