It seems like the document.prototype.unmarkModified() function does not work properly. I am using mongoose version 6.2.4
The following code
device.markModified('sipp');
device.unmarkModified('sipp.queue');
console.log(device.modifiedPaths({ includeChildren: true }))
results in the following log.
[
'sipp',
'sipp.counters',
'sipp.destination',
'sipp.ts',
'sipp.version',
'sipp.connector',
'sipp.parameters',
'sipp.priorityMessages',
'sipp.queue',
'sipp.software',
'sipp.state'
]
I expected the log to not include the sipp.queue in the modified paths list. We don't want to update the queue because of timing issues and therefor update (using $push, $pop etc.) the queue immediately.
The documentation on unmarkModified is limited, so it might just be a misunderstanding on my side.