-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: BSON
-
None
-
Fully Compatible
Currently if one tries to serialize an array or hash to bson which contains values that are not serializable, they get a less than informative exception:
irb(main):006:0> [1..4].to_bson
Traceback (most recent call last):
6: from /home/w/.rbenv/versions/2.7/bin/irb:23:in `<main>'
5: from /home/w/.rbenv/versions/2.7/bin/irb:23:in `load'
4: from /home/w/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/irb-1.2.3/exe/irb:11:in `<top (required)>'
3: from (irb):6
2: from /home/w/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/bson-4.9.3/lib/bson/array.rb:45:in `to_bson'
1: from /home/w/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/bson-4.9.3/lib/bson/array.rb:45:in `put_array'
NoMethodError (undefined method `bson_type' for 1..4:Range)
The exception should specifically state that an unserializable type is attempted to be serialized.
- is depended on by
-
MONGOID-4781 Make embedded matchers work the same as MongoDB server queries
- Released
- links to