MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / _raise_document_too_large

Function _raise_document_too_large

pymongo/message.py:747–759  ·  view source on GitHub ↗

Internal helper for raising DocumentTooLarge.

(operation: str, doc_size: int, max_size: int)

Source from the content-addressed store, hash-verified

745
746
747def _raise_document_too_large(operation: str, doc_size: int, max_size: int) -> NoReturn:
748 """Internal helper for raising DocumentTooLarge."""
749 if operation == "insert":
750 raise DocumentTooLarge(
751 "BSON document too large (%d bytes)"
752 " - the connected server supports"
753 " BSON document sizes up to %d"
754 " bytes." % (doc_size, max_size)
755 )
756 else:
757 # There's nothing intelligent we can say
758 # about size for update and delete
759 raise DocumentTooLarge(f"{operation!r} command document too large")
760
761
762# From the Client Side Encryption spec:

Callers 4

_batched_op_msg_implFunction · 0.85
_check_doc_size_limitsFunction · 0.85

Calls 1

DocumentTooLargeClass · 0.90

Tested by

no test coverage detected