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.


#8

Hi i am trying to find details about the mobile data in cblite 2 using cblite command tools , which comes through couchbase-lite-swift_enterprise_2.1.1 folder , but i am unable to run the tools , as it says comand not found or

shobhakar-mac$ ./cblite

cblite: Couchbase Lite / LiteCore database multi-tool

Missing subcommand or database path.

For a list of subcommands, run cblite help .

To start the interactive mode, run cblite DBPATH

shobhakar-mac$ cblite /downloads/cblite2db

-bash: cblite: command not found

Kindly help me how to use this tool to debug the cblite db , i read the help file , but still the same issue .


#9

For anyone else looking for the response to the above , please refer to this