title: is there a way to create After update triggers or Events in Mongoose?
body: <p>i want to know if there is way to create something like an After insert trigger or an asynchronous event that looks regularly through a log table and then apply the changes to another database.</p>
  
  <p>i found something about the use of middlewares or the use of vanilla js functions but because of the different nommenclatures or perhaps the unclear documentation i don't think that's going to work for me.
  if anyone could clarify the use of post hooks on update or a promise in a function that would be great.</p>
  
  <p>Basically what i want is a trigger or an event that listens to an order details table, i have 2 types of orders: current and delivered in the first type a field called deliveryDate is empty when it's updated and a value is entered in the field it should capture it and insert it in another Database.</p>
  
  <p>i have a function called update that is executed everytime the route <code>'/myApp'</code> gets a <code>POST</code> request here is an example not far from what i want to do 
  here is the route:</p>
  
  <pre><code> module.exports = (app) =&gt; {
   const Something= require('../controllers/something.controller.js')
   // Create a new something
   app.post('/Myapp', Something.update);}
  </code></pre>
  
  <p>here is the controller:</p>
  
  <pre><code>const Something = require('../models/something.model.js');
  const SomethingLog = require('../models/something.log.model.js');
  exports.update = (req, res) =&gt; {//function body} 
  </code></pre>
  
  <p>can i create a post hook under the <code>exports.update</code> function like putting the hook in a function and if i do so how will i be able to execute it should i a just assign it to the default post route wouldn't that conflict with the existing route? thank you</p>