javascript - Loopback - see data before overwriting in "after save" hook -


i've seen question: strongloop : compare old model new instance in operation hook 'before save'

is there way data in db before overwriting done in before save hook? basically, want able pass 1 element update in put request rather pass required fields during request.

it seems looking upsertwithwhere or upsert patch rather put. if , right row can identified (you send along primary id or identify row) passed along data updated/overwritten , rest kept.

that's easy way, if want more advanced (like doing modifies on db before save) have access model in before save hook , modify. remember can before save long postpone "next()" call.


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -