From d3e52fb6a6a2d8964091d3d44e08b48c0341f301 Mon Sep 17 00:00:00 2001 From: Cristian Torres Date: Wed, 3 Nov 2021 00:53:06 -0600 Subject: [PATCH] Updating documentation about `afterFind` callbacks This is added so balderdashy/waterline#1610 can be merged. --- docs/concepts/ORM/Lifecyclecallbacks.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/concepts/ORM/Lifecyclecallbacks.md b/docs/concepts/ORM/Lifecyclecallbacks.md index 9dc018bd5..bb0a6bf47 100644 --- a/docs/concepts/ORM/Lifecyclecallbacks.md +++ b/docs/concepts/ORM/Lifecyclecallbacks.md @@ -6,6 +6,14 @@ Lifecycle callbacks are functions that are called before or after certain model Sails exposes a handful of lifecycle callbacks by default: +##### Lifecycle callbacks on `.find()` + + - afterFind: fn(populatedRecords, proceed) + +##### Lifecycle callbacks on `.findOne()` + + - afterFindOne: fn(thePopulatedRecord, proceed) + ##### Lifecycle callbacks on `.create()` The `afterCreate` lifecycle callback will only be run on queries that have the `fetch` meta flag set to `true`. For more information on using the `meta` flags, see [Waterline Queries](https://sailsjs.com/documentation/reference/waterline-orm/queries/meta).