Mongoose timestamp npm code example Example: mongoose timestamps const userSchema = mongoose.Schema({ email: String }, { timestamps: true });