Can still see deleted document in db


#1

I am using Couchbase lite ios 2.0.
After I delete a document by id, I don’t see the document when I try to query the same document in code. However, when I open db.sqlite3 file in computer, I still see the document. Is this normal, or I have done anything wrong?

Thank you


#2

This is normal. A deleted document still exists as a “tombstone”, so that the deletion can be replicated to other databases.

Looking at the internal SQLite database isn’t likely to be useful unless you know a lot about the implementation of CBL. If you just want to inspect databases, use the cblite command line tool that comes with the Mac & iOS release.


#3

Yes. I was trying to use cblite, but I was keep getting warming.

./cblite file db.sqlite3
Error: Couldn’t open database db.sqlite3: Not a directory (2/20)


#4

You need to open the cblite2 folder itself. Does the program help not mention that?


#5

Thank you so much
I works for me


#6

I had the same question, so thanks. Is there any documentation about the clean up process? I am working on a POC using using Couchbase Lite as a local caching layer for CloudKit. I am not using replications so those deleted items are just wasting space.


#7

On further research, I take it I should use purgeDocument rather than delete. That will get me the behavior I am looking for.