You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Wordit Ltd <wo...@googlemail.com> on 2011/02/12 20:52:38 UTC
userCtx in Views
Can you get the currently authenticated user inside a view?
Is userCtx.name not available? I get no results at all when I use it.
I want to use the username to get values for the currently authenticated user.
I know I can first get the session, then send the username as the key,
but that requires two separate requests.
Thanks,
Marcus
Re: userCtx in Views
Posted by Benoit Chesneau <bc...@gmail.com>.
On Sat, Feb 12, 2011 at 8:52 PM, Wordit Ltd <wo...@googlemail.com> wrote:
> Can you get the currently authenticated user inside a view?
> Is userCtx.name not available? I get no results at all when I use it.
>
> I want to use the username to get values for the currently authenticated user.
> I know I can first get the session, then send the username as the key,
> but that requires two separate requests.
>
> Thanks,
>
> Marcus
>
views know nothing about requests.. The easy way to do that may be to use lists.
- benoƮt
Re: userCtx in Views
Posted by Keith Gable <zi...@ignition-project.com>.
You shouldn't think about views as having any knowledge of anything at
all besides the document. Views emit a key and a value based off of
information available in the document. Views are only computed when a
document changes or when a view changes. They are not computed when
the request runs unless they haven't been computed yet or need to be
recomputed.
On Sat, Feb 12, 2011 at 1:52 PM, Wordit Ltd <wo...@googlemail.com> wrote:
> Can you get the currently authenticated user inside a view?
> Is userCtx.name not available? I get no results at all when I use it.
>
> I want to use the username to get values for the currently authenticated user.
> I know I can first get the session, then send the username as the key,
> but that requires two separate requests.
>
> Thanks,
>
> Marcus
>
--
Keith Gable
A+ Certified Professional
Network+ Certified Professional
Web Developer