MCPcopy
hub / github.com/Automattic/mongoose / handleSuccessfulWrite

Function handleSuccessfulWrite

lib/model.js:3658–3667  ·  view source on GitHub ↗
(document, options)

Source from the content-addressed store, hash-verified

3656}
3657
3658async function handleSuccessfulWrite(document, options) {
3659 if (document.$isNew) {
3660 _setIsNew(document, false);
3661 }
3662
3663 document.$__reset();
3664 document._applyVersionIncrement();
3665 const postFilter = buildMiddlewareFilter(options, 'post');
3666 return document.schema.s.hooks.execPost('save', document, [document], { filter: postFilter });
3667}
3668
3669/**
3670 * Apply defaults to the given document or POJO.

Callers 1

model.jsFile · 0.85

Calls 2

_setIsNewFunction · 0.85
buildMiddlewareFilterFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…