Partially remove documets from local database

Hi! We have lots of public and some private documents. At first only public docs are pulled for unauthenticated user and it takes long time. After user authenticated a set of user-related docs is pulled into the same database. Next, user can logout and even change the account. The question is how to purge all user’s docs after logout while keeping public documents in the local database to prevent pulling them again. The “purge” method seems to be what we need but as I know using it will not allow to pull purged documents again after same user will login second time.

Have you considered using two Couchbase Lite databases that pull from the same Sync Gateway? Db A would get the public docs and Db B would pull the user documents. This approach might simplify things in your use case.


Yes, for now I’m going to implement it using two databases. Just wondering if it will the best approach in my case. Thanks anyway, will report the results.