title: MongoDB Schema for Hotel booking / room availability
body: <p>I’m currently building an  application with a similar model to hotel booking sites.</p>
  
  <p>Currently considering ways of handling availability searching.</p>
  
  <p>My model looks something a little bit like the below:</p>
  
  <p><strong>Hotel</strong><br>
  _id<br>
  name<br>
  description<br>
  star_rating<br>
  address<br>
  lat<br>
  lon  </p>
  
  <p>I then thought of having an availability collection something like this:</p>
  
  <p><strong>Availability</strong><br>
  hotel_id (if availability is it's own collection)<br>
  date<br>
  room_type<br>
  room_max_occupancy<br>
  price  </p>
  
  <p>date would store a single day the room was available<br>
  room_type would be things like “Twin” “Double”<br>
  room_max_occupancy would be 2, 3, etc...  </p>
  
  <p>An example query would be:<br>
  a room in  from 1st-8th June, for 2 people.</p>
  
  <p>For the “search results” I’d need to return hotel.name, hotel.description, hotel.star_rating.</p>
  
  <p>I’m looking for the most efficient way to store this data for the type of query listed above?</p>
  
  <p>Should the availability collection be it’s own collection, or a sub-document of Hotel?</p>
  
  <p>If it’s own collection, should I add the lat lon to the availability (along with hotel_id) to make searching more efficient?</p>