(document, options)
| 3648 | }; |
| 3649 | |
| 3650 | async function buildPreSavePromise(document, options) { |
| 3651 | const preFilter = buildMiddlewareFilter(options, 'pre'); |
| 3652 | const [newOptions] = await document.schema.s.hooks.execPre('save', document, [options], { filter: preFilter }); |
| 3653 | if (newOptions !== options) { |
| 3654 | throw new MongooseError('Cannot overwrite options in pre("save") hook on bulkSave()'); |
| 3655 | } |
| 3656 | } |
| 3657 | |
| 3658 | async function handleSuccessfulWrite(document, options) { |
| 3659 | if (document.$isNew) { |
no test coverage detected
searching dependent graphs…