{"ts":Timestamp(1521530692,1),"t":NumberLong("5"),"h":NumberLong("-384939294837368966"), "v":2,"op":"u","ns":"foo.bar","o2":{"_id":"L0KB$fjfLFra"},"o":{"$set":{"apns":"[]"}}}
Is there any document list all possible format of Mongo's oplog format?
The oplog format is used by MongoDB replication and subject to change between major releases of MongoDB. I'm not aware of any documentation on all possible variations outside of reviewing the code on Github.
However, MongoDB 3.6 introduced a Change Streams API which is a supported interface for third party integration and definitely preferable to using the oplog directly. MongoDB 4.0 adds some further improvements to Change Streams including database-wide or deployment-wide change streams and the option to specify a start time.
If Change Streams does not address your use case, can you provide more detail on what you are trying to achieve and the version(s) of MongoDB you need to support? Regards, Stennie
We are doing some data sync from mysql/mongo to ES for searching. Thanks a lot for your suggestions about change stream which is what we expected. However, we are using mongo 3.2 for the time being. We can migrate to change stream when mongo is updated, and now, we may be have to try to tail the oplog.