title: Loopback Filter Based On Related Model Properties
body: <p>I want to be able to filter based on the properties of related models. For example, I have a Class object with a Building object. I want to get a list of classes that take place in a certain building. </p>
  
  <p>This filter</p>
  
  <pre><code>{  
     "include":"building",
     "scope":{  
        "where":{  
           "name":"warehouse"
        }
     }
  }
  </code></pre>
  
  <p>returns <strong>all</strong> classes, but only includes building if its name is "warehouse". What I want is for the where clause on building name to apply to the whole filter so that I only get the class if it's building has that name.</p>
  
  <p>Is there any way to do what I want?</p>
  
  <p>Thanks!</p>