In a Python script using PyMongo, an index is created for a collection using the line
myCollection.create_index('Datetime', unique=True)
However this throws an error the next time the script is executed because the index already exist.
Question: Is there a way to check for the existance of an index before deciding whether to call create_index?