I wished to capture the time stamp while the document is being synced to the server. In the code snippet below if the date_log attribute is null I am trying to capture the time stamp during the sync process.
if(doc.type == “chat_message” && doc.date_log == null)
doc.date_log = Date.now();
But the above has no effect on the document. Kindly let me know if I have gone wrong somewhere.