-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
Vote.where(:"versions".elem_match => { :updated_at.lte => Time.now.utc})
=> #<Mongoid::Criteria
selector: {"versions"=>{"$elemMatch"=>
}},
options: {},
class: Vote,
embedded: false>
This return empty results
Vote.where(:"versions".elem_match => { :updated_at => { :$lte => Time.now.utc} })
=> #<Mongoid::Criteria
selector: {"versions"=>{"$elemMatch"=>{:updated_at=>{:$lte=>2012-07-17 08:12:44 UTC}}}},
options: {},
class: Vote,
embedded: false>
This however returns correct result. Is it no longer possible to use first approach ?