self.all({where: where}).error(function(err) { emitter.emit('error', err) })
          .success(function(records) {
            var next = function(i) {
              if (i >= records.length) {
                return runQuery(null, records)