Thanks for your patience. If we want to capture old and new values for a document, we can use Pre and Post trigger available in Azure Cosmos DB:
For your requirement, we should go with pre-trigger where we can capture the old values of documents before they got changed.
Create a function triggered by Azure Cosmos DB
Please let us know if this helps or else we can discuss further.