Every day I am importing products from external retailers into a Google Cloud Firestore database.
During that process, products can be either new (a new document will be added to the database) or existing (an existing document will be updated in the database).
Should be noted that I am importing about 10 million products each day so I am not querying the database for each product to check if it exists already.
I am currently using set with merge, which is exactly what I need as it creates a document if it doesn't exist or updates specific fields of an existing document.
Now the question is, how could I achieve a createdAt timestamp given that provided fields will be updated, therefore the original createdAt timestamp will be lost on update? Is there any way to not update a specific field if that field already exists in the document?