I am working on a project where I update the DB and listen for changes with the change streams. I frequently update a document’s nested fields and do it conditionally using the aggregation pipeline update. However, when this change in the DB is reported via the change stream its operationType is set to ‘replace’ instead as ‘update’. I’m doing the update with findOneAndUpdate.
Is there any chance to use the aggregation pipeline for conditional update and also get this change reported as ‘update’ to access the updated and removed fields?