def ensure_index ( self , key , unique = False ) : return self . collection . ensure_index ( key , unique = unique )
check index mongod python
Wrapper for pymongo . Collection . ensure_index
def ensure_index(self, key, unique=False):
        """Wrapper for pymongo.Collection.ensure_index
        """
        return self.collection.ensure_index(key, unique=unique)