def get_last_tid(self):
        try:
            spec = {'tid': {'$gt': 0}}
            sort = [('tid', -1)]
            row = self.db.docs.find_one(spec, sort=sort)
        except Exception as e:
            raise DatabaseException(e)
        if row:
            return row['tid']
        return 0
def __init__(self, config_l, path=None, resolver=None):
        super().__init__(path=path, resolver=resolver)
        self._collection = []
        for key, value in enumerate(config_l):
            self._collection.append(self._from_python(str(key), value))