Add .pre() and .post() middleware delegators and apply on query