Why is the "this" keyword different in a mongoose pre-save hook versus a post-save hook? Why is the "this" keyword different in a mongoose pre-save hook versus a post-save hook? mongoose mongoose

Why is the "this" keyword different in a mongoose pre-save hook versus a post-save hook?


post middleware receives the document as a parameter instead of the next flow control callback parameter that pre middleware receive.

MySchema  .post('save', function(doc) {    console.log(doc);  });