def apply_limit(tasks, limit):
    """
    Cuts the size of tasks list.
    :param tasks: tasks cursor.
    :param limit: limit returned number of documents.
    :return: tasks with set limit.
    """
    return tasks.limit(limit)