title: query date range in MongoDB from nodejs
body: <p>I am trying to get all the users within the specified date range, 
  My database structure looks like this:</p>
  
  <pre><code>{
      _id : ObjectId("58b545d4b57eeb2cc456248a"),
      "attendance" : [ 
          {
              "2017-03-16" : ["58c108b9ebd9ae24dca81634"],
              "2017-03-17" : ["58c108b9ebd9ae24dca81634"],
              "2017-03-18" : ["58c108b9ebd9ae24dca81634"],
              "2017-03-19" : ["58c108b9ebd9ae24dca81634"],
              "2017-03-20" : ["58c108b9ebd9ae24dca81634","58c108b9ebd9ae24dca81635"]
          }, 
          {
              "2017-03-17" : ["58c108b9ebd9ae24dca81634"],
              "2017-03-18" : ["58c108b9ebd9ae24dca81634"],
              "2017-03-19" : ["58c108b9ebd9ae24dca81634"],
              "2017-03-20" : ["58c108b9ebd9ae24dca81634","58c108b9ebd9ae24dca81635"]
          }
      ]
      .......
  }
  </code></pre>
  
  <p>and to query it:</p>
  
  <pre><code>routes.find({_id: ObjectId("58b545d4b57eeb2cc456248a"), $or:[{'attendance[0]' : {$gte: '2017-03-17' }}, {'attendance[1]': {$gte: '2017-03-17'}}]})
  </code></pre>
  
  <p>but it is not fetching any results.</p>