The question of oplog update

at present, a new ChangStream feature has been added to mongo3.6, which makes it easy to retrieve incremental data. But prior to version 3. 6, only the original oplog could be used. On the other hand, there are a large number of $set modifier operations in oplog"s update operation record, and only part of the document can be obtained according to the log when Change Data Capture. I don"t know much about mongo. I don"t know if there is an option for binlog similar to mysql in oplog in mongodb that can be configured as ROW mode. What I want is to get the contents of the entire document during the op:u operation.

Mar.07,2021

oplog only records the changes, and there is no option to choose a different mode. Change stream is based on oplog, so in fact it can only give the part of the change. The Full Document schema gives you the version of the file that has been submitted on most nodes after query. If there are other operations sandwiched between the update and this read, you may get the document after the next update. This is described in the document: Look Full Document for Update Operations

If there are one or more majority-committed operations that modified the updated document after the update operation but before the lookup, the full document returned may differ significantly from the document at the time of the update operation.

do not know what your specific scenario is, know the specific scenario may be able to further explore other solutions.

Menu