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

Function saveSubdocsPostSave

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

Source from the content-addressed store, hash-verified

40}
41
42function saveSubdocsPostSave() {
43 if (this.$isSubdocument) {
44 return;
45 }
46
47 const subdocs = this.$getAllSubdocs({ useCache: true });
48
49 if (!subdocs.length) {
50 return;
51 }
52
53 const options = this.$__.saveOptions;
54 const promises = [];
55 for (const subdoc of subdocs) {
56 promises.push(subdoc._execDocumentPostHooks('save', options));
57 }
58
59 return Promise.all(promises);
60}
61
62function saveSubdocsPreDeleteOne() {
63 const removedSubdocs = this.$__.removedSubdocs;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected