Hi there,
I am trying to filter data on sync gateway from couchbase server to get only specific records but am not able to do that. there are two entries on my server “apple” and “avocado” wherein I am trying to filter those with text as “apple” and show them on sync gateway. Please guide me with the same.
Below is my syncgateway configuration file.
“databases”: {
“grocery-sync”: {
“server”: “http://10.55.18.1:8091”,
“bucket”: “grocery-sync”,
“username”: “user”,
“password”: “password”,
“enable_shared_bucket_access”: true,
“import_docs”: true,
“num_index_replicas”: 0,
“users”: {
“GUEST”: {“disabled”: false, “admin_channels”: ["*"] }
},
“import_filter”: function(doc) { if (doc.text == "apple") { return } }
,
“allow_conflicts”: false,
“revs_limit”: 20
}
}
}
Also, if I add data to my device it is getting reflected on sync gateway and couchbase server but when I add or delete document on the couchbase server only the sync gateway pulls it, the device doesn’t pull it. Please help me .