|
Hi oren.zvuluny@qlik.com,
There are two important things to note with regard to the clusterTime (ChangeStreamDocument.getClusterTime):
- Despite its BSON type is called Timestamp, it is a logical internal timestamp1. It is not associated with a regular Date type (see BSON timestamps).
- A driver has no control over the clusterTime value and resolution: the value is controlled by the MongoDB server, the resolution is set as part of the BSON Timestamp specification.
Thus, not only we cannot change the resolution of clusterTime, but also it should not be relevant to applications that use MongoDB. clusterTime should not be interpreted as a physical timestamp. clusterTime from change stream documents should only be used to partially order the reported changes. The order is partial and not total because changes caused by the same transaction have the same clusterTime.
1 See operationTime in command response for more details. But please keep in mind, that despite this operationTime also represents a logical time of a command, its value is different from the one specified in a change stream document.
|