Hi Darshan. Thanks for the tip. In this case, the oplog module is designed to help keep two seemingly independent replica sets in sync using the same mechanisms that a replica set uses internally (applying oplog messages in an idempotent way).
Obviously, my question is about detecting the creation and deletion of indexes on a database and applying them to another.
But if I look at the documentation for change stream events, I don’t see anything there about index creation/deletion. Nor do I see anything about applying operations from a change stream to another database.
So it feels a little bit like the proposed answer is inadequate for the purpose and that even if I were to embark on rewriting the routine using change streams, I would find it doesn’t offer the most basic “apply” functionality.
It sure would be nice if the database could restore support for applying index creation/deletion operations or at least point to a resource that indicates that such behavior is intentionally disallowed where it was allowed before.
This library implements a more robust version of the mongooplog functionality that used to ship with MongoDB, but if that’s a use case that’s meant to be no longer viable, that would be an acceptable (though disappointing) outcome.