How to apply create/delete index ops to mirror replicaSet

In my previous role, I was developing cutting-edge MongoDB tools. One of the tools I built was jaraco.mongodb, which provides abstractions over some high- and low-level functions in MongoDB. One of the features is the oplog module (docs), which allows tailing an oplog or replaying it to another replica set.

With recent releases of MongoDB (4.2 or 4.4), one of the tests started failing. This test creates and deletes an index and asserts that the index gets created and deleted in the destination replica set, but with late versions of MongoDB fails with the error, “pymongo.errors.OperationFailure: The createIndexes operation is not supported in applyOps mode”.

Can you recommend a replacement behavior to continue to support that use-case?