title: Mongodb find inside sub array
body: <p>I have a document that's setup like this:</p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>{
    _id : ObjectId(),
    info : [ 
          [ 
              1399583281000, 
              20.13
          ], 
          [ 
              1399583282000, 
              20.13
          ], 
          [ 
              1399583283000, 
              20.13
          ], 
          [ 
              1399583285000, 
              20.13
          ], 
          [ 
              1399583286000, 
              20.13
          ]
      ]
  }
  </code></pre>
  
  <p>This data could be spread across multiple documents.  In general, each document contains data in the info for 59 periods (seconds).</p>
  
  <p>What I would like to do is get all of the info data where the timestamp is greater than a specific time.</p>
  
  <p>Any ideas how I would go about doing this?</p>
  
  <p>Thank you</p>
  
  <p>EDIT:</p>
  
  <p>So, I've found that this seems to return all of the documents:</p>
  
  <pre class="lang-js prettyprint-override"><code>db.infos.find({
     info:{
        $elemMatch:{
           0:{
              $gt:1399583306000
           }
        }
     }
  })
  </code></pre>
  
  <p>But maybe I need to use this in an aggregate query? so that it will return just all the values?</p>