简体   繁体   中英

Mongodb 3.6 changestream resumeToken timestamp

I am currently using changestream feature of MongoDB 3.6

We are a heavy update/insert operation and we use changestream to send data for analytics. We need to sync the data in the realtime but since resumeToken is binary, I have hard time finding the timestamp of the operation and hence can't calculate the synchronization lag to analytics.

Is there any way to fetch timestamp from resumeToken or any other way to fetch the operation timestamp.

Is there any way to fetch timestamp from resumeToken or any other way to fetch the operation timestamp.

You can't find out the timestamp of the operation in MongoDB 3.6. There is a plan to add a tool to inspect resumeToken binary to decode it into something useful outside of the server : SERVER-32283 .

In MongoDB 4.0 however, every Change Streams event will also include a field called clusterTime , which is the timestamp of the oplog entry associated with the event. See also change events .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM