couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randall Leeds <randall.le...@gmail.com>
Subject Re: hidden fields in a document
Date Sun, 20 Jun 2010 21:24:47 GMT
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 <tvpavan@gmail.com> 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
>

Mime
View raw message