Replication of Document Deletions to CouchbaseLite

Since I’m using a hybrid of CouchbaseLite and a traditional SQLite database in my mobile app, I need to keep track of both insert/update and delete of documents in Couchbase. During the test I found out that deleting documents on Couchbase server via SyncGateway would leave the documents in place with _deleted set to true. However, when this is replicated to the CouchbaseLite on mobile, I only receive a list of deleted document IDs in the databaseChangeListener, whereas the document themselves are already gone from the database. Is there anyway to find the deleted documents (not the ID) so I can correspondingly make changes in my SQLite database?

For my understanding, I am curious as to why you can’t use the Document IDs to query for the docs in SQLite DB and remove it …

To be more specific, I’m using CoreData on iOS. The deleted documents may correspond to objects of many different models in CoreData. Without knowing what type it is I will have to query one model by one model to find it before I can delete it. This can be very expensive when I delete tens of thousands of documents.

Is there a reason you are using Core Data when Couchbase Lite can handle all of the local persistence for you? There is the overhead of duplicate storage that needs to be considered in your approach among others…

Our app has been using CoreData since the beginning, and most functionalities depend on that. We’d like to transition gradually into Couchbase than just cut it off immediately.