Hello,
we are pretty new to couchbase and evaluating it as an replacement for old sync infrastructure in distributed POS project. I saw some posts about deleted and removed channels but could not find a real answer.
Our Problem:
each document gets one or more channels (we name it tag) assigned that represent branches to that the document must be replicated. Devices (Android) in the branches shall use couchbase light and sync with the master database via sync-gateway (1.5) and later also peer to per (if no internet). Now it can happen that a document might not be valid anymore for one branch, so the respective tag is deleted in the main Database.
But the doc is still in the local light database.
What i tried (maybe stupid):
retrieve the _removed key in the query to get all documents with _removed:false so they are not shown in the query results.
My guess was that if i can retrieve _removed:true documents and delete them they also will be deleted at the server. For sure that should not be the case so my idea just to query them out.
My Sync Config looks like:
{
“log”: [""],
“adminInterface”: “0.0.0.0:4985”,
“interface”: “0.0.0.0:4984”,
“databases”: {
“db”: {
“server”: “http://localhost:8091”,
“bucket”:“esaas0000”,
“username”:“fuekor”,
“password”:“password”,
“admin_channels”:[""],
“enable_shared_bucket_access”:true,
“import_docs”:“continuous”,
“users”: {
“GUEST”: {“disabled”: true, “admin_channels”: [""]}
},
“unsupported”: {
“replicator_2”:true
},
“sync”: function (doc, oldDoc) { if (doc.tags) { channel(doc.tags); } }
}
},
Any help would be appreciated. Thanks in advance and Greets from Manila