Views in the Sync Gateway?


#1

Are there plans to add support for design documents and views to the Sync Gateway REST API? I know it is not intended as a clone of couchdb but this would be very useful.

I would like to be able to query some of my mobile data server side with views. Neither the current REST API nor using a changes feed will achieve what I want to do. It looks like bucket shadowing is deprecated, but it’s either this or run a filtered and synced couchdb just for the views.

What would you recommend?

Thanks

Paul


#2

You can create design documents with custom views via the REST API.
See this thread for the curl commands to create the view and query it.

Currently, Sync Gateway returns all documents when querying custom views on the admin port.
There is an open issue on github to add this functionality on the public, user facing port (4984) which would filter the views to the documents visible to a specific user.

The built-in _all_docs view already returns filtered results.


#3

I didn’t realise this could be done. It looks perfect.

Thank you