I am developing a mobile application which uses couchbase lite as the local database. Local changes are automatically updated to the main database via couchbase sync gateway. I want to check for specific condition and delete all existing documents in the mobile application which are not yet uploaded. How am I going to achieve this? Thanks.
0
votes
Why would you want to delete documents in the mobile application if they are not yet synced to the main database ?
- rajagp
I want to save space in the database at some points.
- Nirmal Gamage
So have these documents already been synced over to the server then? If not, are you stating that you have created the documents in your app that local only to your app and you are deleting them without even syncing them to the cloud??
- rajagp
@rajagp, only for my app and to delete them without syncing them to cloud.
- Nirmal Gamage
1 Answers
0
votes
If you are looking for documents that are local only to the device and that are never synced up, you have couple of options
- Set up a replication filter that will filter documents that are local only (presumably identifiable with some property) to not push those documents up to the server. Also see Pattern 4 section
- You can create a separate instance of Couchbase Lite for device local only documents. There are some caveats- this is described in pattern 2 section)