The documentation of MongoDB states that `ensureIndex` should be deprecated, and an alias of `createIndex`:
Deprecated since version 3.0.0: db.collection.ensureIndex() is now an alias for db.collection.createIndex().
However, upon analysing the code, they seem to have clearly different functionality and `ensureIndex` does not in fact look like a simple alias for `createIndex`:
Expected behaviour is that in light of the deprecation, `ensureIndex` should simply call `createIndex`.
Currently there seem to be some users who still rely on the side effects present in `ensureIndex`, but they should probably receive a deprecation notice as well as instructions on how to migrate to using `createIndex` instead.