Let’s imagine that I am updating a document with a pipeline instead of modifier and I am using $$CLUSTER_TIME
variable to record the time when the update happened. For example:
db.myCollection.update({}, [{ $set: { updatedTs: '$$CLUSTER_TIME } }]);
If I am also observing the same collection with a changes stream, the above operation will result in a change event which will have its own clusterTime
property. I already know that it will not be the same as the value of updatedTs
, but I am wondering if mongo
can guarantee any relation between the two values. For example, is it correct to assume that the high
component of the corresponding Timestamp
objects will be the same for both updatedTs
and changeEvent.clusterTime
?