Oplog update questions

  mongodb, question

Currently, mongo3.6 has added a ChangStream feature, which makes it easy to retrieve incremental data. However, prior to version 3.6, only the original oplog could be used. However, oplog has a large number of $set modifier operations in its update operation record, and only some documents can be obtained according to the log when changing data capture. I don’t know much about mongo. Do you know if there are any mysql-like binlog options in oplog in mongodb that can be configured in ROW mode? The effect I want is to get the contents of the entire document during the op:u operation.

Oplog will only record the changed parts, and there is no option to choose different modes. Change stream is based on oplog, so in fact it can only give changes. Full Document mode gives you the version of this file submitted on most nodes after the query. If there are other operations between the update and this read, you may get the document after the last 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.

I don’t know what your specific scenario is, knowing the specific scenario may further explore other solutions.