code: function cacheResults (results) {
      // get current max record number
      return this.cache.model.maxRecordNumber({
          session: this.query.session,
      }).then(n => {
          // if state has changed do not cache
          if (n !== this.initialMaxRecordNumber) {
              return
          }
          // JSON encode data to cache
          try {
              var cacheValue = JSON.stringify({
                  n: n,
                  v: results,
              })
          }
          catch (err) {
              // ignore errors
          }
          // cache result
          if (cacheValue) {
              debug('view:select:collection:set', this.selectCacheKey)
              return this.cache.redis.setAsync(this.selectCacheKey, cacheValue)
          }
      })
  }
docs: @function cacheResults
  
  cache database results
  
  @param {array} results
  
  @returns {Promise}