title: Filter nested collections using Rxjs
body: <p>I need to filter the following json data structure using Rxjs operators,</p>
  
  <p>consider the following example, we have list of hotels and each hotel as rooms underneath it, we need to get all hotels that have available rooms in it,</p>
  
  <p>so consider the following input as:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var hotels = [
     {
         "hotel": "hotel 1",
         "rooms": [
             {
                 "name": "room 1",
                 "flexible": true
             },
             {
                 "name": "room 2",
                 "flexible": false
             }
         ]
     },
     {
         "hotel": "hotel 2",
         "rooms": [
             {
                 "name": "room 1",
                 "flexible": false
             },
             {
                 "name": "room 2",
                 "flexible": false
             }
         ]
     }
  ];</code></pre>
  </div>
  </div>
  </p>
  
  <p>and the desired output should be as the following:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code> var availableRooms = [
         {
             "hotel": "hotel 1",
             "rooms": [
                 {
                     "name": "room 1",
                     "flexible": true
                 }
             ]
         }    
    ];</code></pre>
  </div>
  </div>
  </p>
  
  <p>so How can I apply this in Rxjs?</p>
  
  <p>Thanks</p>