title: How to define that a model has many of the same model in Strongloop Loopback?
body: <p>What should a models.json look like when I want to define that a Organization has many Organizations?</p>
  
  <p>I tried to define a hasMany through relationshio, using an intermediate model called clients but it didn't work:</p>
  
  <pre><code>"organization": {
    "properties": {
      "name": {
        "type": "string"
      }
    },
    "relations": {
      "clients": {
        "type": "hasMany",
        "model": "organization",
        "foreignKey": "clientId",
        "through": "client"
      }
    }
    "client": {
      "properties": {
        "organizationId": {
          "type": "number",
          "id": true
        },
        "clientId": {
          "type": "number",
          "id": true
        }
      },
      "relations": {
        "organization": {
          "type": "belongsTo",
          "model": "organization",
          "foreignKey": "organizationId"
        },
        "client": {
          "type": "belongsTo",
          "model": "organization",
          "foreignKey": "clientId"
        }
      }
    }
  </code></pre>