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 180CFE4CD for ; Wed, 29 May 2013 07:00:47 +0000 (UTC) Received: (qmail 60249 invoked by uid 500); 29 May 2013 07:00:45 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 59965 invoked by uid 500); 29 May 2013 07:00:41 -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 59887 invoked by uid 99); 29 May 2013 07:00:37 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 May 2013 07:00:37 +0000 Received: from localhost (HELO [192.168.0.3]) (127.0.0.1) (smtp-auth username garren, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 May 2013 07:00:37 +0000 From: Garren Smith Content-Type: multipart/alternative; boundary="Apple-Mail=_9EAE2474-3434-4E46-A260-59B063D73420" Message-Id: Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: [ASK] How to passing 1st view data to 2nd view?? Date: Wed, 29 May 2013 09:00:33 +0200 References: To: user@couchdb.apache.org In-Reply-To: X-Mailer: Apple Mail (2.1503) --Apple-Mail=_9EAE2474-3434-4E46-A260-59B063D73420 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 Hi Polutan, I don't know the full context of your problem. But I think you should be = able to do something like this: Create a view with a map: function (doc) { var t =3D new Date(doc['dateOfEntry'); emit([doc.accountName, t.getFullYear(), t.getMonth(), = t.getDay()], 1); } You would most likely have to create some if clauses to check the doc = has all these values. When you query the view you use the following parameters:=20 start_key =3D ["MyAccountName", 2013,1,1 ] - Change the date to be the = start of time range that you want your data for. end_key =3D ["MyAccountName", 2013,12,31] - Again change the date range = to suit your needs include_docs =3D true - so you get the docs. This should give you all the docs for your account in the specific date = range. Cheers Garren On 28 May 2013, at 5:49 PM, polutan wrote: > @Garren > Hi Garren :) thank you for your reply. > But i still don't understand with your explanation. Please give me an > example. I don't understand with ur statement " emit that date range = as > well as the account number" . >=20 > Thank You :) >=20 >=20 > 2013/5/22 Garren Smith >=20 >> Hi Polutan, >>=20 >> I think you could get what you want by just using one view. For your = view >> keys emit that date range as well as the account number. Then when = you do a >> query of the data include the date range as well as the account = number that >> you want this data for. Couchdb will then return the balance sheet = entries >> for that date range belonging to your account number. >>=20 >> Cheers >> Garren >>=20 >> On 22 May 2013, at 11:39 AM, polutan wrote: >>=20 >>> What??? I can't believe it :( >>> So. any other alternative for my case? >>>=20 >>> Thank You :) >>>=20 >>>=20 >>> 2013/5/22 Dave Cottlehuber >>>=20 >>>> On 22 May 2013 09:37, Andrey Kuprianov = >>>> wrote: >>>>> Hi, >>>>>=20 >>>>> There's a 1st edition available, as opposed to reading a draft: >>>>> http://guide.couchdb.org/editions/1/en/index.html >>>>>=20 >>>>> Andrey >>>>=20 >>>> The draft ironically is the newer 1.x release edition. Confusing! >>>>=20 >>>=20 >>>=20 >>>=20 >>> -- >>> *Coklat Stroberi -- Web Dev Training Centre* >>> http://www.facebook.com/pages/Coklat-Stroberi/249514251728226 (info >> lebih >>> lanjut) >>> http://coklatstroberi.net >>> Jl. Raya Padang Luwih (Dalung) No.141 - Telp. (0361) 9006118 atau >>> 08174128301 - Badung, Bali. Sebelah timur traffic light pertigaan >> perumahan >>> dalung permai. >>=20 >>=20 >=20 >=20 > --=20 > *Coklat Stroberi -- Web Dev Training Centre* > http://www.facebook.com/pages/Coklat-Stroberi/249514251728226 (info = lebih > lanjut) > http://coklatstroberi.net > Jl. Raya Padang Luwih (Dalung) No.141 - Telp. (0361) 9006118 atau > 08174128301 - Badung, Bali. Sebelah timur traffic light pertigaan = perumahan > dalung permai. --Apple-Mail=_9EAE2474-3434-4E46-A260-59B063D73420--