I don\'t understand the difference between create_index and ensure_index in pymongo. On the MongoDB indexes page, it says
yo
Keep in mind that in Mongo 3.x ensureIndex is deprecated and should be discouraged.
Deprecated since version 3.0.0: db.collection.ensureIndex() is now an alias for db.collection.createIndex().
The same is in pymongo:
DEPRECATED - Ensures that an index exists on this collection.
Which means that you should always use create_index.