Unable to sync couchbase view in pouchdb using couchbase sync gateway


#1

I am new to couchbase and pouchdb,
I am trying to get couchbase view result in pouchdb,but pouchdb unable to sync when i tried this code :

remoteDatabase url is(sync gateway url)=http://localhost:4984/sync_gateway

database.replicate.from(remoteDatabase, {
live: true,
retry: true,
filter: ‘_view’,
view: ‘_design/dev_Test/_views/Test1’
});
It doesnt replicate anything. I want to replicate view as In couchbase I have documents with 100+ fields but in pouch I want only few fields,for that I have created view in couchbase and trying to replicate in pouchdb. Thanks in advance


#2

I am new to Couchbase and i’m wanting to do the exact same thing as you.
One issue that you are facing is that the public API of the sync gateway doesn’t allow you to query a view. The Admin API does expose this but you are probably using a user that can’t access the admin API.