-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: Docs
From the docs (tested behavior --> correct as of Mongoid 7.5):
.in has historically wrapped non-``Array`` values in arrays, as the following example demonstrates: Band.in(year: 1950) #=> #<Mongoid::Criteria selector: \{"year"=>{"$in"=>[1950]}} This wrapping behavior is deprecated and should not be relied on. It may be removed in a future release of Mongoid.
It would be good to resolve the deprecation and move forward here. My preference to do so would be to have Band.in(year: 1950) behave the same as Band.where(year: 1950):
Band.in(year: 1950)
#=> #<Mongoid::Criteria selector: \{"year"=>1950}}
Other ideas are also acceptable; key requirement is not to have dangling "Mongoid supports this but please don't use it" lines in the documentation.