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 85C5FFF24 for ; Sat, 1 Jun 2013 19:23:29 +0000 (UTC) Received: (qmail 36676 invoked by uid 500); 1 Jun 2013 19:23:28 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 36631 invoked by uid 500); 1 Jun 2013 19:23:28 -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 36623 invoked by uid 99); 1 Jun 2013 19:23:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Jun 2013 19:23:27 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,MIME_QP_LONG_LINE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_FRT_BELOW2,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of north.n@gmail.com designates 209.85.212.171 as permitted sender) Received: from [209.85.212.171] (HELO mail-wi0-f171.google.com) (209.85.212.171) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Jun 2013 19:23:21 +0000 Received: by mail-wi0-f171.google.com with SMTP id hq7so1592081wib.10 for ; Sat, 01 Jun 2013 12:23:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:from:content-type:x-mailer:in-reply-to :message-id:date:to:content-transfer-encoding:mime-version; bh=Yw9z2dFAx6wcOXFAv8E21NnUjJyJIsm8s0N+rLbQxGI=; b=xMEX+O5WeacGgg7jEaUd+yyqYi9xHCwHUQtozKvUFV8CtfBYCbX1akEHQvn4+GT4K/ KJnE1dr/sXMaHL27UnzvzmGvD/NwXTWrQHKeH19M66SPVuXbkOSY7+6BqVIyKr82JKPU /Ez+BPl+uzGIHLet3uYAhE/K9wbuFpT4YQow9ironKyXXHxKeROE++H/ufjqmTGKFMLI FW6TDxVoaW/WO6RK9w6hu9V6hb44S61yjgoXq8E73x2iil4vuu8KZs4OzkaIwOjXmkMe BbrQN6P54WJ0kA2QXz2mgBtVKvXpYfCw4XRaWvEpKy7Vpal0L4BA2bAXFrBEWwR0K0de nrgw== X-Received: by 10.194.47.240 with SMTP id g16mr13819997wjn.43.1370114581489; Sat, 01 Jun 2013 12:23:01 -0700 (PDT) Received: from [192.168.0.6] (cpc1-mort6-2-0-cust743.croy.cable.virginmedia.com. [94.172.194.232]) by mx.google.com with ESMTPSA id k10sm12202957wia.4.2013.06.01.12.22.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Jun 2013 12:23:00 -0700 (PDT) Subject: Re: [ASK] How to passing 1st view data to 2nd view?? References: From: Nick North Content-Type: multipart/alternative; boundary=Apple-Mail-E02A80C6-76C9-447D-BB47-7769339238A3 X-Mailer: iPhone Mail (10B350) In-Reply-To: Message-Id: <2B71623A-C9F5-4801-8F81-39D0FC805F49@gmail.com> Date: Sat, 1 Jun 2013 20:17:58 +0100 To: "user@couchdb.apache.org" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (1.0) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-E02A80C6-76C9-447D-BB47-7769339238A3 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable There is a discussion of why transactions are not necessary at http://guide.= couchdb.org/draft/recipes.html. Nick On 1 Jun 2013, at 19:59, Robert Newson wrote: > Document updates are atomic. > On 1 Jun 2013 18:12, "Brad Rhoads" wrote: >=20 >> You dont have atomic transactions in couchdb. So it might not be the righ= t >> db for an accounting app. >> On May 21, 2013 11:53 PM, "polutan" wrote: >>=20 >>> Hello Folks :) >>>=20 >>> I learn to make a very simple accounting app using CouchDB as my data >>> storage. >>> I need to create balance sheet report, and certainly the report must be >>> able to show by date periode >>> (example: from 2013-01-01 unti 2013-0131) . My plan is create two view. >> And >>> i will doing query 2 times. >>> The 1st view will give me data filtered by date range. The 2nd view will= >>> filter data from 1st view by account number range. >>> So.. i need to know, how to passing 1st view data to 2nd view? >>>=20 >>> Ok, what i've done so far is created two view with two different key >>> arrangement. >>> My 1st view http://easycaptures.com/fs/uploaded/641/0865962213.png named= >>> journal_date_acc which is >>> having date-accountNumber key arrangement. ["2013/05/14", 1000, 1010, >> 1011] >>> then My 2nd view >>> http://easycaptures.com/fs/uploaded/641/2476449270.pngnamed >>> journal_acc_date which is >>> having accountNumber-date key arrangement. [1000, 1010, 1011, >> "2013/05/14"] >>>=20 >>> And this is my document structure http://pastebin.com/RUrBYMWR . >>>=20 >>> I've test my views, and i doing test bellow: >>> this is for my 1st view >> http://host:5984/myfinance/_design/journal/_view/journal_date_acc?group=3D= true&startkey=3D[ >>> "2013/05/14"]&endkey=3D["2013/05/16"] >>> {"rows":[ >> {"key":["2013/05/14",1000,1010,1011],"value":{"debit":0,"credit":60000000= ,"totalItem":2,"accLevel1Desc":"Aset","accLevel2Desc":"Kas","accLevel3Desc":= "Kas >>> Kantor Pusat"}}, >> {"key":["2013/05/14",1000,1100,1101],"value":{"debit":50000000,"credit":0= ,"totalItem":1,"accLevel1Desc":"Aset","accLevel2Desc":"Kendaraan","accLevel3= Desc":"Mobil >>> Dinas"}}, >> {"key":["2013/05/14",5000,5100,5101],"value":{"debit":10000000,"credit":0= ,"totalItem":1,"accLevel1Desc":"Biaya_dan_Beban","accLevel2Desc":"Gaji","acc= Level3Desc":"Gaji >>> Karyawan Bagian Penjualan"}} >>> ]} >>>=20 >>>=20 >>> this is test for my 2nd view >> http://host:5984/myfinance/_design/journal/_view/journal_acc_date?group=3D= true&startkey=3D[1000,1010,1011 >>> , >>> "2013/05/14"]&endkey=3D[1000,1100,1101,"2013/05/16"] >>> {"rows":[ >> {"key":[1000,1010,1011,"2013/05/14"],"value":{"debit":0,"credit":60000000= ,"totalItem":2,"accLevel1Desc":"Aset","accLevel2Desc":"Kas","accLevel3Desc":= "Kas >>> Kantor Pusat"}}, >> {"key":[1000,1100,1101,"2013/05/14"],"value":{"debit":50000000,"credit":0= ,"totalItem":1,"accLevel1Desc":"Aset","accLevel2Desc":"Kendaraan","accLevel3= Desc":"Mobil >>> Dinas"}} >>> ]} >>>=20 >>> Ok, once again, how to passing 1st view data to 2nd view? I want to >> filter >>> data by date range in 1st view,, then i want to filter it again >>> by account number range in 2nd view. How to? >>>=20 >>> Thank You :) >>=20 --Apple-Mail-E02A80C6-76C9-447D-BB47-7769339238A3--