What events trigger mongoose pre hooks?

Hello, when we are creating mongoose pre hook we need to pass the event that will triger the function as the first argument. In this example, this is “save”:

someSchema.pre("save", function(next) {
    // do something
    next()
})

And I want to know more about this events. What is this “save” event and where I can find more about thems and their types?

Hello there.

Why not head over to the official documentation: https://mongoosejs.com/docs/api.html#document_Document-save

Poke around there, for a while. Hope this helps