couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Carter <>
Subject Re: Rewrite /user/bob to user:bob
Date Fri, 19 Aug 2011 16:44:18 GMT
On Thu, Aug 18, 2011 at 1:47 PM, Simon Leblanc <> wrote:
> I see 3 options:
> use different databases for users and stuffs, but that means two design documents and
it kind of defeats the purpose of couchapps
> use uuids and deal with names in a custom manner. Sounds difficult. I would really prefer
the third option:
> use a naming convention for ids, like user:bob and stuff:somestuff.

I have option #4 for you: instead of using a show function, use a
list.  You still use UUIDs for the ID, and you just have a view that
emits all "users" keyed on the unique username.  Since that username
is (theoretically) unique, your list function can be designed to just
show one user ever, and then you rewrite to it.


View raw message