I am creating a PouchDb like so :
var db = new PouchDB('my_db',
{ auto_compaction: true, revs_limit: 1, adapter: 'websql' });
Then I create and delete a number of records :
db.put({ _id: '1'});
db.put({ _id: '2'});
db.put({ _id: '3'});
db.get('1')
.then(function(doc) {
db.remove(doc)
});
db.get('2')
.then(function(doc) {
db.remove(doc)
});
db.get('3')
.then(function(doc) {
db.remove(doc)
});
From my reading of the documentation, this is the correct way to delete and remove records.
And this SO question and answer seems to suggest also that this is the way to do things.
However, if I use the Chrome inspector to look at my Web SQL DB, the records are still there :
I don't believe this is not a timing issue or anything like that, as I can refresh with just the delete code and then get a 404 not_found error
My application creates and keeps records in a local pouchDb until they have been synced to central server, at which time I want to clear them from the local database.
I'm creating lots of records and if I cannot clear them out then eventually I'm going to run out of space on the device (it is hybrid HTML5 mobile app).
Is it even possible to actually remove records from a local PouchDB?
If so, how do I do it?
If not, what is a good solution that I can easily swap in place of PouchDB?
(I'm really hoping it is possible because I've gone down this path of development, so if the answer to the first question is No, then I need a good answer to the third question)