Getting millisecond timestamp value from clusterTime change stream

I see clusterTime is a Timestamp object returned from change stream updates. Is it possible to convert this to a millisecond value? I currently only see the high_ which looks like a unix timestamp (in seconds), but what if updates come sub-second? Is there any way to distinguish which one came first on the server?

Thanks

I just run into same issue. Looks like the clusterTime doesn’t have the milliseconds and when I use it to check any new changes after the change, it will return the clusterTime associated record as new change which cause wait for next timeout if no new changes.

Should it be a defect and it should be improved to include milliseconds in the Timestamp? I am trying to check on multiple collections and only want to watch for it if new changes exist.

Thank you for possible help, MongoDB team!

Mary

I am thinking of return the changes and compare with documentId as workaround first instead of just a count of 0 or 1.
However, it’s not efficient.
Hope MongoDB can find better solution.