I have a mobile app that uses couchbase lite for local storage. A couchbase server instance is used as a backup/restore repository. Each mobile user’s data is backed up by doing a push to the server where each user’s data is a unique channel. Each document in the user’s database also has a field identifying the channel. User data restore is a pull from the remote server after purging all of the local documents. The server also has a node.js web service for user management via the Sync Gateway Admin REST Api.
I’d like to add functionality to 1) check if there’s is previously backed up data on the server for a given user and 2) clear the backed up data if the user chooses to do so.
What are the mechanism to do so? I checked the Sync Gateway REST Api and Admin Rest API and i didn’t see any that would be able to do that. How can’t I check if a specific channel exists or delete a specific channel?
Would I need to use the Couchbase Node.js SDK in my node.js web service and connect to the Couchbase server directly and query the documents.