v1.2.0
BigDecimal and any registry-known type store natively; custom codecs are honoured.
Highlights
- 01
Registry-backed value encoding
Values the storage codec has no native form for are now encoded through the collection's effective codec registry, using the same lookup a real driver performs. BigDecimal reaches the store as Decimal128, and any type with a codec is stored as that codec writes it instead of failing fast.
- 02
Custom codecs the Spring Boot way
MongoClientSettingsBuilderCustomizer beans are invoked and their codec registry adopted by the embedded client, so a custom Codec registered the idiomatic Boot way just works. The same is true of withCodecRegistry on any client, database or collection view.
Full notes
Added
- Spring: MongoClientSettingsBuilderCustomizer beans (and a MongoClientSettings bean) are invoked at context refresh and their codec registry adopted onto the shared embedded client, so custom codecs registered the idiomatic Boot way reach the store. An application's own MongoClient bean keeps its registry; withCodecRegistry still wins per view. A codec baked inline into the settings a mongoClientFactory seam bean builds is captured too. The seam probes the factory with a neutral URI and adopts the registry it carries, so a hand-rolled multi-tenant factory keeps its codec where production needs it and it works under the harness as-is.
Fixed
- BigDecimal (and every other type the effective codec registry can encode) now stores instead of failing fast with codec.unsupported-type. Values are encoded at the wire boundary through the collection's registry, using the same registry.get(value.getClass()) lookup a real driver performs. BigDecimal reaches the store as Decimal128 across insert, replace, $set/$inc/$push, upsert seeds, filters, bulkWrite, findOneAndReplace and transaction staging. BSON-native values take an identity fast path and are byte-identical. codec.unsupported-type now means only that no codec in the registry can encode the value (plus MinKey/MaxKey/undefined, which have no storable representation). Fifteen m20-codec differential scenarios pin it against real MongoDB, including a precision-and-scale scenario that stores 34-digit Decimal128 values, binary-float traps and trailing-zero scale byte-identically to a real server.