I suspect you could achieve what you're looking for with a rewrite handler[1] and a show function[2] that rewrites "/db/mydoc" to "/db/_design/safe/_show/document/mydoc".
Check it out and see what you think. [1]http://blog.couch.io/post/443028592/whats-new-in-apache-couchdb-0-11-part-one-nice-urls [2]http://wiki.apache.org/couchdb/Formatting_with_Show_and_List#Showing_Documents On Sat, Jun 19, 2010 at 22:01, Pavan Kumar <[email protected]> wrote: > Hi , > > I have a need where certain fields in a document shouldn't seen while > responding for GET document API's. For e.g the document store's certain > fields which are internal to the application not to be seen by end user. The > same is for design documents where i don't want the users to see my > views,filters,validate_doc_update code. Similar to treating _id and _rev as > special fields, can we have double underscore fields which is special, e.g > "__internalId". These fields are accessible to all view,shows etc but not > for direct json out. In design documents we could change the name of view > field to "__views". Let only "admin" role uses only access these fields. > > There must be surely a better way to achieve the same need ? > > To avoid exposing out internal details we could place an intermediary app > layer, but just was thinking if this could be useful to have feature like > this in couchdb itself. > > regards, > Pavan >
