def update_documents(
        index_name: str,
        body_dict: dict,
        marqo_config: config.Config = Depends(get_config)):
    """
    Update an array of documents in a given index. Please refer to
    [Update document API](https://docs.marqo.ai/latest/reference/api/documents/update-documents/) for details.
    """
    # TODO this a temporary fix due to the mixed use of pydantic v1 and v2.
    #  UpdateDocumentsBodyParams can be injected after migrated to v2
    body = parse_request_object(UpdateDocumentsBodyParams, body_dict)

    res = marqo_config.document.partial_update_documents_by_index_name(
        index_name=index_name, partial_documents=body.documents)

    return JSONResponse(content=res.dict(exclude_none=True, by_alias=True), headers=res.get_header_dict())

    Update an array of documents in a given index. Please refer to
    [Update document API](https://docs.marqo.ai/latest/reference/api/documents/update-documents/) for details.
    
src/marqo/tensor_search/api.py