codec_options
– Tools for specifying BSON codec options¶
Tools for specifying BSON codec options.
-
class
bson.codec_options.
CodecOptions
¶ Encapsulates BSON options used in CRUD operations.
Parameters: - document_class: BSON documents returned in queries will be decoded
to an instance of this class. Must be a subclass of
MutableMapping
. Defaults todict
. - tz_aware: If
True
, BSON datetimes will be decoded to timezone aware instances ofdatetime
. Otherwise they will be naive. Defaults toFalse
. - uuid_representation: The BSON representation to use when encoding
and decoding instances of
UUID
. Defaults toPYTHON_LEGACY
.
- document_class: BSON documents returned in queries will be decoded
to an instance of this class. Must be a subclass of