どういうわけかexpireAfterSeconds
MongoAlchemyでコレクションのインデックスを指定できますか、または次のようにハックする必要があります:
class TtlIndex(Index):
def expires(self, seconds):
self.expireAfterSeconds = seconds
def ensure(self, collection):
extras = {}
if self.__min is not None:
extras['min'] = self.__min
if self.__max is not None:
extras['max'] = self.__max
if self.__bucket_size is not None:
extras['bucket_size'] = self.__bucket_size
if self.expireAfterSeconds:
extras['expireAfterSeconds'] = self.expireAfterSeconds
collection.ensure_index(self.components, unique=self.__unique,
drop_dups=self.__drop_dups, **extras)
return self