Package Exports
- pouchdb-erase
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pouchdb-erase) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
pouchdb-erase
A replicating db.destroy() alternative for PouchDB. Works by iterating over all documents in the database and deleting them. Uses batches and changes() internally. It's a drop-in replacement for db.destroy().
Example
npm install pouchdb pouchdb-erase//index.js
var PouchDB = require('pouchdb');
PouchDB.plugin(require('pouchdb-erase'));
var db = new PouchDB('test');
db.erase().then(function (resp) {
console.log(resp) //{ok: true}
})Browser usage
<script src='dist/pouchdb-erase.min.js'></script>
<script>
PouchDB.plugin(Erase);
new PouchDB('test').erase();
</script>API
db.erase([options[, callback]])the only option in
optionsis at the moment batch_size, it determines how much documents are collected before they are removed all at once in one batch.callbackis optional, as shown in the example a promise interface is also provided.