# About

Middleware or 'Hooks' are functions that are executed right before or right after a specific action on an entity.\
Hooks are available for the following methods

* Entity.save() (also executed on Model.**update()**)
* Model.delete()
* Model.findOne()
* On your custom methods

Your hooks **must return a Promise** and you must use the "Promised" version of the methods, **not** the callback.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sebloix.gitbook.io/gstore-node/v8.x/middleware-hooks/about.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
