Closed angelhodar closed 3 years ago
Just released 0.14.0 with a new feature for this, here's how to use it: https://github.com/mongodb-js/mongoose-autopopulate/blob/master/examples.md#it-can-pass-a-list-or-regular-expression-of-functions-to-apply-hooks-to
Hey, I just wanted to know if it is possible to specify only a subset of hooks where this plugin should be used. For example, I want this plugin to trigger after creating or updating a resource to return the populated response directly to the client, but I dont want to autopopulate when making a GET request as I already have implemented populate and select from URL query params. This would avoid to manually set { autopopulate : false } for that queries.
Thanks!