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 exists(self):
        collection = self.client.api.cm.shared.licensing.pools_s.get_collection(
            requests_params=dict(
                params="$filter=name+eq+'{0}'".format(self.want.name)
            )
        )
        if len(collection) == 1:
            return True
        elif len(collection) == 0:
            return False
        else:
            raise F5ModuleError(
                "Multiple license pools with the provided name were found!"
            )