title: how can i use limit in include model using sequelize
body: <p>i want to get user's images at limit 2 from Follow model.</p>
  
  <p>Models</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const Follow = connector.define('Follow', {
      no: {
          type: Sequelize.INTEGER,
          primaryKey: true,
          autoIncrement: true
      },
      follower_id: {
          type: Sequelize.INTEGER,
          allowNull: true
      },
      target_id: {
          type: Sequelize.INTEGER,
          allowNull: true
      },
      isDelete: {
          type: Sequelize.BOOLEAN,
          allowNull: false
      },
      create_dt,
      delete_dt
  }
  
  const User = connector.define('User', {
      no: {
          type: Sequelize.INTEGER,
          primaryKey: true,
          autoIncrement: true
      },
      username: {
          type: Sequelize.STRING,
          allowNull: false
  
      },
      email: {
          type: Sequelize.STRING,
          allowNull: false
      },
      password: {
          type: Sequelize.STRING,
          allowNull: false
      },
      profile_img: {
          type: Sequelize.STRING,
          allowNull: true
      },
      bio: {
          type: Sequelize.STRING,
          allowNull: true
      },
      phone: {
          type: Sequelize.STRING,
          allowNull: true
      },
      gender: {
          type: Sequelize.STRING,
          allowNull: true
      },
      website: {
          type: Sequelize.STRING,
          allowNull: true
      },
      isDelete: {
          type: Sequelize.BOOLEAN,
          allowNull: false
      },
      create_dt,
      update_dt,
      delete_dt
  }
  
  const Image = connector.define('Image', {
      no: {
          type: Sequelize.INTEGER,
          primaryKey: true,
          autoIncrement: true
      },
      file: {
          type: Sequelize.STRING,
          allowNull: false
      },
      location: {
          type: Sequelize.STRING,
          allowNull: true
      },
      caption: {
          type: Sequelize.STRING,
          allowNull: true
      },
      tags: {
          type: Sequelize.STRING,
          allowNull: true
      },
      isDelete: {
          type: Sequelize.BOOLEAN,
          allowNull: false
      },
      create_dt,
      update_dt,
      delete_dt,
      user_id: {
          type: Sequelize.INTEGER,
          allowNull: true
      }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>and, join</p>
  
  <pre><code>User.hasMany(Image, {foreignKey: 'user_id'})
  Image.belongsTo(User, {foreignKey: 'user_id'})
  
  User.hasMany(Follow, {foreignKey: 'follower_id'})
  Follow.belongsTo(User, {foreignKey: 'follower_id'})
  
  User.hasMany(Follow, {foreignKey: 'target_id'})
  Follow.belongsTo(User, {foreignKey: 'target_id'})
  </code></pre>
  
  <p>so, i tried get user's images from follow by use include.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const followerImages = await Follow.findAll({
              attributes: ['target_id'],
              where:{
                  follower_id: loginUser_id
              },
              include:[
                  {
                      model: User,
                      required: true,
                      attributes: ['username', 'email', 'profile_img'],
                      include:[
                          {
                              model: Image,
                              required: true
                          }
                      ]
                  }
              ]
          })</code></pre>
  </div>
  </div>
  </p>
  
  <p>but i want to get images at limit 2.</p>
  
  <p>so i tried that</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const followerImages = await Follow.findAll({
              attributes: ['target_id'],
              where:{
                  follower_id: loginUser_id
              },
              include:[
                  {
                      model: User,
                      required: true,
                      attributes: ['username', 'email', 'profile_img'],
                      include:[
                          {
                              model: Image,
                              required: true,
                              limit: 2
                          }
                      ]
                  }
              ]
          })</code></pre>
  </div>
  </div>
  </p>
  
  <p>but it makes bugs i cant understand.</p>
  
  <p>images field is a array contain empty object at 4.</p>
  
  <p>all same..</p>
  
  <p>what is the problem?</p>
  
  <p>how can i solve this problem??</p>