Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A0A8A4393 for ; Tue, 17 May 2011 21:16:58 +0000 (UTC) Received: (qmail 62391 invoked by uid 500); 17 May 2011 21:16:57 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 62363 invoked by uid 500); 17 May 2011 21:16:56 -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 62355 invoked by uid 99); 17 May 2011 21:16:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 May 2011 21:16:56 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of marcello.nuccio@gmail.com designates 209.85.210.52 as permitted sender) Received: from [209.85.210.52] (HELO mail-pz0-f52.google.com) (209.85.210.52) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 May 2011 21:16:52 +0000 Received: by pzk35 with SMTP id 35so605094pzk.11 for ; Tue, 17 May 2011 14:16:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=A273f8BkQaHZHHqvk3cm6XGjak6aAj4JjWCq816vlOE=; b=MoktF//1Ag/GbZej6P5QLOTJ4f8/2prVR7GFtGj20bxewdLz9/WMs5pDUrrrvAjrlY BDVThpOVN3O+M4GchvFvMWTU94SInACrulB8AUB6qaOhp5fWSz4HWSrKKhunEjH8JtZV gkwUd8qpZSeq7yoAIdeH6pHo4xgiq6KcCMkRQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=vRTtNvhzIpiEdrGz350+F2uhinXLQiE+Jn+blQLJU6RlqnsA727AErUP4zGRanQRb2 IcGcrb0scsV7KGvUTRrlvrnhX0T/6XzoFJq9gwNSKNzkRGucBlPIaK3ZFOy9Tn6exH3Q PImpX9yh+ZAdGAuWBH0Up9o3/rJdMVpcVYfZw= MIME-Version: 1.0 Received: by 10.68.3.139 with SMTP id c11mr1689408pbc.277.1305666991437; Tue, 17 May 2011 14:16:31 -0700 (PDT) Received: by 10.68.57.102 with HTTP; Tue, 17 May 2011 14:16:31 -0700 (PDT) In-Reply-To: References: <4DD236DA.6030100@gmail.com> Date: Tue, 17 May 2011 23:16:31 +0200 Message-ID: Subject: Re: querying inside a view function From: Marcello Nuccio To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List functions have access to multiple documents. http://guide.couchdb.org/draft/transforming.html http://wiki.apache.org/couchdb/Formatting_with_Show_and_List hope it helps, Marcello 2011/5/17 Fabio Batalha Cunha dos Santos : > Hi, > > As I thought! > > We have this accomplished in application level. > > The problem is that we use couchdb as a webservices label for some apps a= nd > we intend to supply the data in a more accurated level. > > We will try to make changes in the data model, including some journal dat= a > in the article data. > > Thanks. > *Fabio Batalha C. Santos* > Colegiado SciELO > www.scielo.org > FAPESP - CNPq - BIREME - FapUNIFESP > > > > On Tue, May 17, 2011 at 5:50 AM, Stefan K=F6gl wr= ote: > >> Hi, >> >> Am 2011-05-16 22:43, schrieb Fabio Batalha Cunha dos Santos: >> > In a view function, I would to query the database to get a specific >> > info that are stored in another document in the same database. >> >> No, that's not possible. A view function's result should only depend on >> the document for which it is called, not on any other states (such as >> the database). Otherwise this would yield different results without >> changes to the document - these changes could then not be detected >> because the view function is only evaluated when a document is >> changed/replicated. >> >> I am not quite sure what you are trying to accomplish, but maybe you can >> move the logic you want to implement to the application instead? >> >> >> -- Stefan >> >