Hi, There's a 1st edition available, as opposed to reading a draft: http://guide.couchdb.org/editions/1/en/index.html
Andrey On Wed, May 22, 2013 at 3:27 PM, Dave Cottlehuber <[email protected]> wrote: > On 22 May 2013 07:52, polutan <[email protected]> wrote: > > Hello Folks :) > > > > 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? > > > > 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"] > > > > And this is my document structure http://pastebin.com/RUrBYMWR . > > > > 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=true&startkey=[ > > "2013/05/14"]&endkey=["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","accLevel3Desc":"Mobil > > Dinas"}}, > > > {"key":["2013/05/14",5000,5100,5101],"value":{"debit":10000000,"credit":0,"totalItem":1,"accLevel1Desc":"Biaya_dan_Beban","accLevel2Desc":"Gaji","accLevel3Desc":"Gaji > > Karyawan Bagian Penjualan"}} > > ]} > > > > > > this is test for my 2nd view > > > http://host:5984/myfinance/_design/journal/_view/journal_acc_date?group=true&startkey=[1000,1010,1011 > , > > "2013/05/14"]&endkey=[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","accLevel3Desc":"Mobil > > Dinas"}} > > ]} > > > > 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? > > > > Thank You :) > > Hi Polutan, > > You're running into some very basic (intentional) design limits in > couchdb. I suggest you take a bit of time out and read the free & > awesome definitive guide http://guide.couchdb.org/draft/index.html > first. It will save you a lot of time headbanging against stuff that > isn't possible. The sofa chapter is sadly out of date, so skip that, > but the concepts and explanations of how couchdb works are still > relevant. > > Multi-set operations such as intersections and unions need to be done > outside CouchDB, in general. > > So you'll need to query one view, then the other, and then process as > appropriate. > > A+ > Dave >
