title: How to access data of another persisted model of loopback from remote method of one persisted model?
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>'use strict';
  module.exports = function (City) {
  City.GetCurrentPopulation = function (req) {
  var population;
  City.app.models.Pupulation.find({where{id:req.id}}, //This line //gives me an error that cannot read property 'find' of undefined 
  function(req.res){
  population=res.population;
  });
  response='Population for ' +req.cname ' is' +population;
  req(null, response);
  };
  City.remoteMethod(
      'GetCurrentPopulation', {
        http: {
          path: '/GetCurrentPopulation',
          verb: 'GetCurrentPopulation'
        },
        returns: {
          arg: 'startdate',
          type: 'string'
        }
      }
    );</code></pre>
  </div>
  </div>
  </p>
  
  <p>There is a model city and i want to access another model like "population.find(some filters)" How to do this?</p>
  
  <p>I have a remote method written in city model. Where i am trying to access population record as</p>
  
  <p>var countryp=population.find(where{id:4});</p>
  
  <p>var currentpopulation=countryp.Totalpopulation;</p>
  
  <p>It gives an error population.find is not a function.</p>
  
  <p>Please suggest way to do this.</p>