I have created a new View via Admin REST API and i am able to see data only in Admin port (4985). When i query the view via Users Port (4984), i am getting total rows as 0.
SG Version: 1.3.1
Couchbase Server Version: 3.03
Note: I have custom Map and reduce function for the view
Below is the response i get.
{“total_rows”:0,“rows”:null,“Collator”:{}}
Below is the response i get when running on Admin port.
{
“total_rows”:2,
“rows”:[
{“id”:"",“key”:“catalog1”,“value”:{“Soap”:1,“Toothbrush”:1}},
{“id”:"",“key”:“catalog2”,“value”:{“Soap”:1}}
],
“Collator”:{}
}
My Sync Gateway config.json
{
“log”: [“CRUD”, “REST+”, “Access”],
“databases”: {
“sk”: {
“unsupported”: {
“user_views”: {
“enabled”: true
},
“oidc_test_provider”: {
“enabled”: false
}
},
“users”: {
“GUEST”: {
“disabled”: false, “admin_channels”: [" * “]
}
},
“CORS”: {
“Origin”: [”"],
“LoginOrigin”: [""],
“Headers”: [“Content-Type”],
“MaxAge”: 1782000
},
“server”: “http://localhost:8091”,
“bucket”: “default”,
“sync”: “function(doc) { if(doc.catalogs) { for(var i = 0; i < doc.catalogs.length; i++) { channel(doc.catalogs[i]); } } }”
}
}
}
I have tried restarting the sync-gateway also. still not getting right data.
Need some help on getting data while querying view via user port.