Hello,
I would like to know when the timestamps `createdAt` and `updatedAt` are added to the schema instance and what (ie mongoose or mongo) does the job.
From the schema below
````
const Schema = mongoose.Schema(
{
///whatever
},
{
timestamps: true,
}
);
module.exports = mongoose.model("MySchema", Schema);
```
then
```
let mySchema = new MySchema({...})
// at this point in time the timestamp values do not exist in mySchema
mySchema().save().then( (data) => {
// at this point in time the timestamps have been created
} )
```
Are the timestamp created during the save, or in a pre-save hook, or in a post-save-hook ?
Are the timestamp created by mongoose itself before connecting to the mongo database? or are they created by the mongo database itselve from instructions provided by mongoose.
Thanks for your help