I would like to know if it is possible to simulate the result of an updateOne or updateMany operation without persisting the changes and get the result, but I did not found any way to do this. ¿Is there any way to do it without performing a local hard code update in a document locally?
First of all, thank you for your answers John_Sewell and Steeve.
Finally I decided to use aggregations. I thought that the modifications made by $set operator modifying matching documents after a $match pipeline were persisted in the database. It was just my lack of knowledge about aggregations. This method solved my problem.
Thank you very much and I hope this is useful for anyone having the same doubt!