title: Nested Querying in Mongoid in 2013
body: <p>So this question is two years old:</p>
  
  <p><a href="https://stackoverflow.com/questions/5259121/querying-embedded-objects-in-mongoid-rails-3-lower-than-min-operators-and-so">Querying embedded objects in Mongoid/rails 3 (&quot;Lower than&quot;, Min operators and sorting)</a></p>
  
  <p>and the way it recommends to query nested objects with less than or greater than:</p>
  
  <pre><code>current_user.trips.where('start.time' =&gt; {'$gte' =&gt; Time.now}).count
  </code></pre>
  
  <p>simply doesn't work, it returns 0 for the numerous queries I have like this which is wrong. I've also tried </p>
  
  <pre><code>current_user.trips.where(:'start.time'.gte =&gt; Time.now}).count
  </code></pre>
  
  <p>which is also 0. None of these actually throw an error. </p>
  
  <p>What is the correct syntax for querying nested elements nowadays? Seems to be a fair bit of confusion over this.</p>