How can I delete PouchDB Database indefinitly, to free space?

前端 未结 2 1994
感动是毒
感动是毒 2021-01-14 04:17

How can I drop a database in PouchDB to get the space on the disk free again? Remove only sets a paramter _deleted and keeps the Data of the record anyway.
But how can

相关标签:
2条回答
  • 2021-01-14 05:05

    You can destroy the database and create it again.

    var _db = new PouchDB('foo');
    
    var reset = function() {
      _db.destroy().then(function() {
        _db = new PouchDB('foo');
      });
    };
    
    0 讨论(0)
  • 2021-01-14 05:12

    It sounds like you are looking for compaction. It will do exactly what you describe. :)

    0 讨论(0)
提交回复
热议问题