bsonutil.IsEqual() will always return true. This means that IndexCatalog.DeleteIndexes() will delete all indexes from the index catalog for a collection if there is an oplog entry that attempts to drop an index by key pattern. Thus no indexes will be built for that collection.
IndexCatalog.collMod() will attempt to modify the first index in the index catalog for a collection if there is an oplog entry that attempts to collMod an index by key pattern.
This was introduced as part of TOOLS-2041 in v100.4.0. These two IndexCatalog methods are the only places bsonutil.IsEqual() is used. No tools other than mongorestore are affected.
Huge thanks to A40in on GitHub for discovering this bug: https://github.com/mongodb/mongo-tools/pull/358#issuecomment-915861493
bsonutil.IsEqual() should be fixed. We should also make it impossible for IndexCatalog.DeleteIndexes() to delete more than one index if a single key is provided.