title: Scala function tries to return Unit instead of Future
body: <p>I am writting a scala function which follows the following workflow:</p>
  
  <ul>
  <li>take an id as parameter.</li>
  <li><p>use the id to get a object from mongo database. Here I am using reactive mongo.</p></li>
  <li><p>after getting the object make another query to the database to get a list of items and return it.</p></li>
  </ul>
  
  <p>I have implemented this workflow in the following way:</p>
  
  <pre><code>def functionA(id:String):Future[List[Hotel]]={
      var futureHotel = hotelRepository.getHotel(id) // returns Futue[Option[Hotel]]
      val result = for {
        r&lt;-futureHotel
      }yield (hotelRepository.getHotels(r.get.giataid)) // this is supposed to be Future[List[Hotel]]
    }
  </code></pre>
  
  <p>It gives me error message like: <code>Type mismatch. Found Unit require Future[List[Hotel]]</code></p>
  
  <p>As I am new to Scala, I am sure I am missing something. Will be cool if someone can point out. Any clue or help will be appreciated.</p>