Documentation Index
Fetch the complete documentation index at: https://databridge-add-core-funcs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
def update_document_by_filename_metadata(
filename: str,
metadata: Dict[str, Any],
new_filename: Optional[str] = None,
) -> Document
async def update_document_by_filename_metadata(
filename: str,
metadata: Dict[str, Any],
new_filename: Optional[str] = None,
) -> Document
Parameters
filename (str): Filename of the document to update
metadata (Dict[str, Any]): Metadata to update
new_filename (str, optional): Optional new filename to assign to the document
Returns
Document: Updated document metadata
Examples
from morphik import Morphik
db = Morphik()
# Update just the metadata of a document identified by filename
updated_doc = db.update_document_by_filename_metadata(
filename="report.pdf",
metadata={"status": "reviewed", "reviewer": "Jane Smith"},
new_filename="reviewed_report.pdf" # Optional: rename the file
)
print(f"Updated metadata: {updated_doc.metadata}")
from morphik import AsyncMorphik
async with AsyncMorphik() as db:
# Update just the metadata of a document identified by filename
updated_doc = await db.update_document_by_filename_metadata(
filename="report.pdf",
metadata={"status": "reviewed", "reviewer": "Jane Smith"},
new_filename="reviewed_report.pdf" # Optional: rename the file
)
print(f"Updated metadata: {updated_doc.metadata}")