title: Sails.js: how to Join multiple models using waterline?
body: <p>I've 3 models Continent,Country and city. I'd like to join these models to get the results.</p>
  
  <h2>Continent.js</h2>
  
  <pre><code>attributes: {
  
  continent_Id:{
  
      type:'string',
      primaryKey: true
  
  
  },
  continent_Name:{
  
      type:'string'
  },
  description:{
  
   type:'string'
  
  },
  country:{
          collection: 'country',
          via: 'continent'
  }
  </code></pre>
  
  <p>}</p>
  
  <h2>Country.js</h2>
  
  <pre><code>attributes: {
  
  country_Id:{
  
      type:'string',
      primaryKey: true
  },
  
  countryName:{
  
      type:'string'
  },
  
  description:{
  
    type:'string'
  
  },
  
  continent:{
          model:'continent'
      },
  
   languages:{
  
      collection:'Country_language',
      via:'country'
   },
  
   city:{
  
      collection:'city',
      via:'country'
  
   }
  }
  </code></pre>
  
  <p>city.js</p>
  
  <pre><code>attributes: {
  
  city_Id:{
  
      type:'string',
      primaryKey:true
  },
  
  cityName:{
  
   type:'string'
  
  },
  
  description:{
  
   type:'string'
  
  },
  
  country:{
  
      model:'country'
  }
  </code></pre>
  
  <p>Now I can get the results by using Model.query :</p>
  
  <pre><code>var query = 'select a.continent_Name,b.countryName,c.cityName from continent a inner join country b on a.continent_id = b.continent inner join city c on b.country_Id = c.country';
  
  Continent.query(query,function(err,data){
       console.log(data);
  });
  </code></pre>
  
  <p>and the result is:</p>
  
  <p>[ { continent_Name: 'ASIA',
      countryName: 'India',
      cityName: 'Delhi' } ]</p>
  
  <p>Is there any way to get the same results by using 'waterline' query like </p>
  
  <pre><code> Continent.find().populate().where({}).exec(function(err,data){
     console.log(data);
   });
  </code></pre>