MCPcopy Create free account
hub / github.com/Automattic/mongoose / saveSubdocsPreDeleteOne

Function saveSubdocsPreDeleteOne

lib/plugins/saveSubdocs.js:62–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60}
61
62function saveSubdocsPreDeleteOne() {
63 const removedSubdocs = this.$__.removedSubdocs;
64 if (!removedSubdocs?.length) {
65 return;
66 }
67
68 const options = this.$__.saveOptions;
69 const promises = [];
70 for (const subdoc of removedSubdocs) {
71 promises.push(subdoc._execDocumentPreHooks('deleteOne', options));
72 }
73
74 return Promise.all(promises);
75}
76
77function saveSubdocsPostDeleteOne() {
78 const removedSubdocs = this.$__.removedSubdocs;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected