-
Type: Task
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
https://jira.mongodb.org/browse/RUBY-2867 changed bson-ruby to deserialize decimal128 to BigDecimal by default. This causes a compatibility issue with Mongoid in case a field is declared to be of BSON::Decimal128 type:
field :foo, type: BSON::Decimal128
In this case the application desires to not convert to BigDecimal (perhaps to preserve +/- NaNs), but bson-ruby would deserialize to BigDecimal anyway at which point Mongoid won't be able to preserve the value type as BSON::Decimal128.
The proposed solution is to have Mongoid request that bson-ruby returns either decimal128 or all objects as their BSON types, and subsequently Mongoid will demongoize all of the types to their correct field types as declared by the application.
After fixing this issue, we should enable MONGOID tests skipped for bson-master in this ticket - https://jira.mongodb.org/browse/MONGOID-4657
- backported by
-
MONGOID-5630 Backport MONGOID-5631 to Mongoid 8.x
- Closed
- is caused by
-
RUBY-2867 Change Decimal128 to deserialize to BigDecimal by default
- Closed
- is related to
-
MONGOID-4657 Test mongoid against bson 5.0 (master)
- Closed
-
MONGOID-5360 Warn when defining field types of BSON::Int64/Decimal128 and other unsupported types
- Closed
- related to
-
MONGOID-5071 Force int64 storage via BSON::Int64 field type
- Closed