def get_index_names()

in jobs/mongodb_migration/src/mongodb_migration/migrations/_20230511100700_queue_delete_indexes_with_force.py [0:0]


def get_index_names(index_information: Mapping[str, Any], field_name: str) -> list[str]:
    return [
        name
        for name, value in index_information.items()
        if isinstance(value, dict)
        and "key" in value
        and any(t[0] == field_name for t in value["key"] if isinstance(t, tuple) and len(t))
    ]