code: function fetch (fetchNum, offset) {
      // if all records already fetched resolve with undefined
      if (this.done) {
          return Promise.resolve([])
      }
      // set default fetchNum
      if (!fetchNum) {
          fetchNum = this.fetchNum
      }
      // if offset is set then set fetched with offset
      if (offset) {
          this.fetched = offset
      }
      // if fetchNum exceeds numner of remaining records then set to max
      fetchNum = _.clamp(fetchNum, this.length - this.fetched)
      // get list of ids to fetch
      var ids = this.ids.slice(this.fetched, this.fetched + fetchNum)
      // create where args for records query
      var whereArgs = {id: ids}
      // if isDeleted was set on original query then set for fetch
      if (defined(this.query.args.where.isDeleted)) {
          whereArgs.isDeleted = this.query.args.where.isDeleted
      }
      // fetch records
      return this.query.model.query({
          all: true,
          allow: this.query.args.allow,
          cache: this.query.args.cache,
          plain: this.query.args.plain,
          raw: this.query.args.raw,
          resolve: this.query.args.resolve,
          session: this.query.session,
          where: whereArgs,
          with: this.query.args.with,
          view: this.applyView ? this.query.args.view : false,
      })
      .then(records => {
          // add number of fetched records to count of fetched
          this.fetched += fetchNum
          // set done to true when all records fetched
          if (this.fetched === this.length) {
              this.done = true
          }
  
          return records
      })
  }
docs: @function fetch
  
  loads up to fetchNum more records and stores them as array in buffer
  
  @param {integer} fetchNum
  @param {integer} offset
  
  @returns {Promise}