How to use the pouchdb-utils.flatten function in pouchdb-utils

To help you get started, we’ve selected a few pouchdb-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pouchdb / pouchdb / packages / node_modules / pouchdb-abstract-mapreduce / src / index.js View on Github external
})).then(function (listOfDocsToPersist) {
          var docsToPersist = flatten(listOfDocsToPersist);
          lastSeqDoc.seq = seq;
          docsToPersist.push(lastSeqDoc);
          // write all docs in a single operation, update the seq once
          return view.db.bulkDocs({docs : docsToPersist});
        });
      });
github pouchdb / pouchdb / packages / node_modules / pouchdb-adapter-http / src / index.js View on Github external
return function (err, res) {
          // err is impossible because shim returns a list of errs in that case
          results[batchNum] = res.results;
          if (++numDone === numBatches) {
            callback(null, {results: flatten(results)});
          }
        };
      }
github pouchdb / pouchdb / packages / node_modules / pouchdb-replication / src / getDocs.js View on Github external
.then(function (results) {
        resultDocs = resultDocs.concat(flatten(results).filter(Boolean));
      });
    });