title: Loopback HasManyThrough relation working only one way
body: <p>I have 2 Models "Jobdetails" and "Jobvenues" which has a "HasManyThrough" relation Through Model "JobDetailsHasVenues" </p>
  
  <p>Jobdetails Model: </p>
  
  <pre><code>{
   "name": "Jobdetails",
   "properties": {
  "jobname": {
    "type": "String",
    "required": true,
    "length": 250,
    "precision": null,
    "scale": null,
    "mysql": {
          ---
       },
    "_selectable": false
  }
  },
  "relations": {
  "jobvenues": {
    "type": "hasMany",
    "model": "Jobvenues",
    "foreignKey": "jobdetailsId",
    "through": "JobdetailsHasVenues"
  }
  }
  </code></pre>
  
  <p>And Jobvenues Model as : </p>
  
  <pre><code>{
  "name": "Jobvenues",
  "properties": {
  "storename": {
    "type": "String",
    "required": true,
    "length": 200,
    "precision": null,
    "scale": null,
    "mysql": {
     ----
     },
    "_selectable": false
  }
  }
  "relations": {
  "jobdetails": {
    "type": "hasMany",
    "model": "Jobdetails",
    "foreignKey": "venueId",
    "through": "JobdetailsHasVenues"
     }
  }
  </code></pre>
  
  <p>The Through Model is defined as </p>
  
  <pre><code> {
    "name": "JobdetailsHasVenues",
     {
      "jobdetailsid": {
       "type": "Number",
       "required": true,
      "length": null,
      "precision": 10
        ---,
      "venueid": {
      "type": "Number",
      "required": true,
      "length": null,
      "precision": 10
       ----
       },
      },
  "relations": {
      "jobdetail": {
      "type": "belongsTo",
      "model": "Jobdetails",
      "foreignKey": "jobdetailsId"
     },
     "jobvenue": {
     "type": "belongsTo",
     "model": "Jobvenues",
     "foreignKey": "venueId"
    }
  }
  </code></pre>
  
  <p>When I query </p>
  
  <pre><code>    Jobdetails.find({
        filter:{
          where:{and:[{'status':{neq:3}},{'id':{neq:jobId}}]},
          include:'jobvenues'
            }
         })
  </code></pre>
  
  <p>The jobvenues are are not present in the result. 
  But if I query </p>
  
  <pre><code> Jobvenues.find({
        filter:{
          where:{venueid:jobdetailsId}}]},
          include:'jobdetails'
            }
         })
  </code></pre>
  
  <p>In result I can see related jobdetails ..... </p>
  
  <p>I have refered many posts including the documentation at <a href="https://docs.strongloop.com/display/public/LB/HasManyThrough+relations" rel="nofollow noreferrer">Strong Loop</a></p>
  
  <p>Here <a href="https://stackoverflow.com/questions/32252867/loopback-api-include-filters-not-working-as-expected">Stackoverflow</a></p>
  
  <p>But cant get my code working right ..... </p>
  
  <p>One more observation... If I query through Loopback Explorer and query through 
  GET /Jobdetails/{id}/jobvenues -- I can see the related jobvenues. </p>
  
  <p>But if use "include filter" in  query GET /Jobdetails/{id} I get empty array of jobvenues.</p>