MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / _inflate_bson

Function _inflate_bson

bson/raw_bson.py:62–74  ·  view source on GitHub ↗

Inflates the top level fields of a BSON document. :param bson_bytes: the BSON bytes that compose this document :param codec_options: An instance of :class:`~bson.codec_options.CodecOptions` whose ``document_class`` must be :class:`RawBSONDocument`.

(
    bson_bytes: bytes | memoryview,
    codec_options: CodecOptions[RawBSONDocument],
    raw_array: bool = False,
)

Source from the content-addressed store, hash-verified

60
61
62def _inflate_bson(
63 bson_bytes: bytes | memoryview,
64 codec_options: CodecOptions[RawBSONDocument],
65 raw_array: bool = False,
66) -> dict[str, Any]:
67 """Inflates the top level fields of a BSON document.
68
69 :param bson_bytes: the BSON bytes that compose this document
70 :param codec_options: An instance of
71 :class:`~bson.codec_options.CodecOptions` whose ``document_class``
72 must be :class:`RawBSONDocument`.
73 """
74 return _raw_to_dict(bson_bytes, 4, len(bson_bytes) - 1, codec_options, {}, raw_array=raw_array)
75
76
77class RawBSONDocument(Mapping[str, Any]):

Callers 7

batch_commandMethod · 0.90
mark_commandMethod · 0.90
encryptMethod · 0.90
mark_commandMethod · 0.90
encryptMethod · 0.90
_inflate_bsonMethod · 0.85
_inflate_bsonMethod · 0.85

Calls 1

_raw_to_dictFunction · 0.90

Tested by

no test coverage detected