loopback before save options code example
Example 1: loopback get relationship in before save
// it is not availabe in the "before save" event.
// you must do a Model.find()
Example 2: hook access loopback
Model.observe('access', function logQuery(ctx, next) {
console.log('Accessing %s matching %s', ctx.Model.modelName, ctx.query.where);
next();
});