create() triggers - before save - after save updateById() triggers - before save - after save destroy() triggers - before delete - after delete The implementation here is intentionally left with less features than the regular DAO methods provide, the goal is to get a partial (but still useful!) version released soon. Limitations: - `before save` & `after save` hooks don't provide `ctx.isNewInstance` - async validations are not supported yet - `persist` and `loaded` hooks are not triggered at all - `before delete` hook does not provide `ctx.where` property and it's not possible to change the outcome of `destroy()` using this hook. Note that regular DAO does support this. - updating embedded instances triggers update of the parent (owning) model, which is correct and expected. However, the context provided by `before save` and `after save` hooks on the parent model is sort of arbitrary and may include wrong/extra data. The same probably applies to the scenario when deleting embedded instances triggers update of the parent model. |
||
---|---|---|
.. | ||
helpers | ||
operation-hooks.suite | ||
.eslintrc | ||
CustomTypeForeignKey.test.js | ||
async-observer.test.js | ||
basic-querying.test.js | ||
common.batch.js | ||
common_test.js | ||
crud-with-options.test.js | ||
datasource.test.js | ||
datatype.test.js | ||
default-scope.test.js | ||
defaults.test.js | ||
discovery.test.js | ||
events.js | ||
geo.test.js | ||
hooks.test.js | ||
include.test.js | ||
include_util.test.js | ||
init.js | ||
introspection.test.js | ||
json.test.js | ||
loopback-data.test.js | ||
loopback-dl.test.js | ||
manipulation.test.js | ||
memory.test.js | ||
mixins.test.js | ||
mock-connectors.js | ||
model-definition.test.js | ||
optional-validation.test.js | ||
performance.coffee | ||
persistence-hooks.suite.js | ||
relations.test.js | ||
schema.test.js | ||
scope.test.js | ||
spec_helper.js | ||
test1-schemas.json | ||
test2-schemas.json | ||
transient.test.js | ||
util.test.js | ||
validations.test.js |