title: Mongoose select query between two time range
body: <p>Ok this is getting interesting, im working on a school project schedule, and use mongoDB,
  which has no time attribute.</p>
  
  <p>I want to query between two time ranges in a class.</p>
  
  <blockquote>
    <p>This SQL Query works but im trying this in mongoose:</p>
  </blockquote>
  
  <pre><code>SELECT * From Schedule WHERE room_name = ?  AND ((start_time) BETWEEN @KP and @KD OR (end_time) BETWEEN @KP and @KD)  AND day=?
  </code></pre>
  
  <p>For example:</p>
  
  <blockquote>
    <p>First lecture starts from 08:00 till 09:00 in room number 8 on Monday.</p>
    
    <p>If i try to add another lecture with start time: 08:30 end time: 09:30 in room number 8 on Monday , it should tell me that i can not because the class is busy at the moment.</p>
  </blockquote>
  
  <p>This is the Schema im using:</p>
  
  <pre><code>    day: Number,
      start_time: Date,
      end_time: Date,
      room: [{ type: Schema.Types.ObjectId, ref: 'Room' }]
  </code></pre>
  
  <p>I need ideas how can i solve this :) because im a begginer in mongo.</p>