From user-return-14874-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Sat Feb 12 20:46:10 2011 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 84531 invoked from network); 12 Feb 2011 20:46:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Feb 2011 20:46:09 -0000 Received: (qmail 25908 invoked by uid 500); 12 Feb 2011 20:46:08 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 25870 invoked by uid 500); 12 Feb 2011 20:46:07 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 25861 invoked by uid 99); 12 Feb 2011 20:46:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Feb 2011 20:46:07 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ziggythehamster@gmail.com designates 209.85.210.180 as permitted sender) Received: from [209.85.210.180] (HELO mail-iy0-f180.google.com) (209.85.210.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Feb 2011 20:46:02 +0000 Received: by iyh42 with SMTP id 42so3620640iyh.11 for ; Sat, 12 Feb 2011 12:45:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=Tx+UahIM3Hr5w2l/vBBIg61wzo7trKfpKeXDASjcyd0=; b=lbadVRT1nhr6pSVcMSRQwg8Vw+txsnN/dWsdNPvZMdd7EdBFS6kvgVGD0ismBh5GTI Vm4fOCI999J3ibszgZMdwY1tf84hh4bmUQOO8HM4TKnUhWT2vEoXCz9bI4yikP0oeyn0 2Yzy70I+9aIzlqDI+BVrcY012QV3HGVCZhb/c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=IJzPpD+mT5ud1hA6uEAe+bi/Ry25LlCvkzNi84jFKyrbKFVDl9OBHboozlaliGTpyq d7wyp94kds3dP11SNPb5eBZh7wQViLbSzvLj9F6TgQ8Uva016I5f1dAYBZwcpTUQrdwg nOFugEOn4fSrQH+UyRM5vODocWPtx1uNbA3SM= MIME-Version: 1.0 Received: by 10.42.229.135 with SMTP id ji7mr2632912icb.37.1297543542351; Sat, 12 Feb 2011 12:45:42 -0800 (PST) Sender: ziggythehamster@gmail.com Received: by 10.42.175.129 with HTTP; Sat, 12 Feb 2011 12:45:42 -0800 (PST) In-Reply-To: References: Date: Sat, 12 Feb 2011 14:45:42 -0600 X-Google-Sender-Auth: mATB22b3eUpGd2u5BDVnaZ-VBQA Message-ID: Subject: Re: userCtx in Views From: Keith Gable To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 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 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