Calling a native API view from the REST API?


#1

While I’ve been working with the native iOS API for a while now, my knowledge of the REST API is limited, so please excuse if this is a boneheaded question, but…

I have some views created with the native iOS API. They’re written in Swift and using the native API, all is happy.
However, my environment is mixed native/hybrid; so, I now have a use case however that I would like to call the REST API from within a UIWebView on the client to query a view created by the native API. I know I can create design documents and views with the REST API, but since the REST API’s access point to query views is related to the design document it doesn’t seem possible to call a natively-created view from REST.

Am I just missing something obvious, or do I need to have two versions of views, native and REST/design document based in order to satisfy this? Since native views are so much more performant, I’d rather just use the native view…

Thanks


#2

Just name the native view with a slash in it, like “a/b”, then you can query it from REST as though there were a design doc “_design/a” with a view named “b”.


#3

Awesome, I’ll give that a try. Thanks!