def index_mongo():

    db = api.common.get_conn()

    log.debug("Ensuring mongo is indexed.")

    db.users.ensure_index("uid", unique=True, name="unique uid")
    db.users.ensure_index("username", unique=True, name="unique username")

    db.groups.ensure_index("gid", unique=True, name="unique gid")
    db.problems.ensure_index("pid", unique=True, name="unique pid")

    db.submissions.ensure_index("tid", name="submission tids")
    db.ssh.ensure_index("tid", unique=True, name="unique ssh tid")
    db.ssh.ensure_index("tid", sparse=True, name="sparse ssh tid")
    db.teams.ensure_index("team_name", unique=True, name="unique team names")

    db.cache.ensure_index("expireAt", expireAfterSeconds=0)
    db.cache.ensure_index("kwargs", name="kwargs")
    db.cache.ensure_index("args", name="args")
Return logger that stores the logged messages for later use
dataset/ETHPy150Open IceCTF/ctf-platform/api/api/setup.py/index_mongo--crossover with--dataset/ETHPy150Open duerrp/pyexperiment/pyexperiment/Logger.py/Logger._get_pseudo_instance