def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
async def print_debug(loop):
    while True:
        print(chr(27) + "[2J")  # clear screen
        loop.print_debug_info()
        await asyncio.sleep(0.5)