So this question is two years old:
Querying embedded objects in Mongoid/rails 3 ("Lower than", Min operators and sorting)
and the way it recommends to query nested objects with less than or greater than:
current_user.trips.where('start.time' => {'$gte' => Time.now}).count
simply doesn't work, it returns 0 for the numerous queries I have like this which is wrong. I've also tried
current_user.trips.where(:'start.time'.gte => Time.now}).count
which is also 0. None of these actually throw an error.
What is the correct syntax for querying nested elements nowadays? Seems to be a fair bit of confusion over this.