If there is more then one item in result.res.rows this will add all of
them.
On Feb 23, 2014 7:31 AM, "Tomasz Kołodziejski" <notifications@github.com>
wrote:

> In lib/adapters/idb.js:
>
> > +            // all done, time to collate
> > +            var keysToResults = {};
> > +            for (var i = 0; i < resultsToCollate.length; i++) {
> > +              var result = resultsToCollate[i];
> > +              if (result.err) {
> > +                utils.call(callback, err);
> > +                return;
> > +              } else {
> > +                keysToResults[result.key] = result;
> > +              }
> > +            }
> > +            var results = [];
> > +            keys.forEach(function (key) {
> > +              var result = keysToResults[key];
> > +              if (result.res.rows.length) {
> > +                results = results.concat(result.res.rows);
>
> Isn't it the same as results.push(result.res.rows[0])? This one above
> kinda suggests like there are more of them. Just asking if I understand it
> right.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/daleharvey/pouchdb/pull/1340/files#r9975549>
> .
>