title: Can we compare only time in mongodb?
body: <p>I have stored happyHours of hotels in date time format. Now I want to fetch all hotels whose happyHours are greater than current time. </p>
  
  <p>As per my knowledge I know there is date comparison to fetch result but this will compare whole date time object. </p>
  
  <p>Is there any way to compare time only?</p>
  
  <p>Happyhours date object sample in db:</p>
  
  <pre><code>"happyHours" : {
      "mon" : [ 
          {
              "startTime" : ISODate("2016-04-11T06:30:59.000Z"),
              "endTime" : ISODate("2016-04-11T14:30:59.000Z")
          }
      ],
      "tue" : [ 
          {
              "startTime" : ISODate("2016-04-11T06:30:59.000Z"),
              "endTime" : ISODate("2016-04-11T14:30:59.000Z")
          }
      ],
      "wed" : [ 
          {
              "startTime" : ISODate("2016-04-11T06:30:59.000Z"),
              "endTime" : ISODate("2016-04-11T14:30:59.000Z")
          }
      ],
      "thu" : [ 
          {
              "startTime" : ISODate("2016-04-11T06:30:59.000Z"),
              "endTime" : ISODate("2016-04-11T14:30:59.000Z")
          }
      ],
      "fri" : [ 
          {
              "startTime" : ISODate("2016-04-11T06:30:59.000Z"),
              "endTime" : ISODate("2016-04-11T14:30:59.000Z")
          }
      ],
      "sat" : [ 
          {
              "startTime" : ISODate("2016-04-11T06:30:59.000Z"),
              "endTime" : ISODate("2016-04-11T14:30:59.000Z")
          }
      ],
      "sun" : [ 
          {
              "startTime" : ISODate("2016-04-11T06:30:59.000Z"),
              "endTime" : ISODate("2016-04-11T14:30:59.000Z")
          }
      ]
  }
  </code></pre>