Re: annoying javascript problem in Reduce phases

2011-03-10 Thread Antonio Rohman Fernandez
thanks, so... we can assume there will be maximum only 2 reduce phases? even if there are hundreds of maps? just for curiosity. Rohman Antonio Rohman Fernandez CEO, Founder & Lead Engineer roh...@mahalostudio.com Projects MaruBatsu.es PupCloud.com Wedding Album On Mar

Re: annoying javascript problem in Reduce phases

2011-03-10 Thread Alexander Sicular
Echo what Sean said. Also I have a post on my blog about pagination and riak. As Sean said, it is basically a reduce(sort) , reduce(slice) to get it working. -Alexander. @siculars on twitter http://siculars.posterous.com Sent from my iPhone On Mar 10, 2011, at 8:26, Antonio Rohman Fernande

Re: annoying javascript problem in Reduce phases

2011-03-10 Thread Antonio Rohman Fernandez
Riak is NOT an SQL-like system -> yep, i know that and its query limitations, however, i thought that doing a pagination would be a piece of cake :P thanks for the reply : ) Rohman Antonio Rohman Fernandez CEO, Founder & Lead Engineer roh...@mahalostudio.com Projects Mar

Re: annoying javascript problem in Reduce phases

2011-03-10 Thread Sean Cribbs
On Mar 10, 2011, at 8:26 AM, Antonio Rohman Fernandez wrote: > Dear Sean, > thank you for your quick reply. > > "Your reduce function can (almost) never assume that it is operating on the > entire result set." -> wow! that totally kills my implementation... i wanted > to use the Reduce phase t

Re: annoying javascript problem in Reduce phases

2011-03-10 Thread Antonio Rohman Fernandez
Dear Sean, thank you for your quick reply. "Your reduce function can (almost) never assume that it is operating on the entire result set." -> wow! that totally kills my implementation... i wanted to use the Reduce phase to cut the array as a Limit + Pagination ( like LIMIT 10 PAGE 2 in SQL )...

Re: annoying javascript problem in Reduce phases

2011-03-10 Thread Sean Cribbs
Antonio, Sorry it's a little buried in the documentation, but be aware that Reduce phases *may* be called more than once (CouchDB calls this rereduce). What you experience in the last example is a demonstration of that: you must structure your reduce function such that it can receive as inputs

annoying javascript problem in Reduce phases

2011-03-10 Thread Antonio Rohman Fernandez
Dear All, I'm having a pretty annoying Javascript problem and would like to know if is a bug (most likely) or if somebody has a solution. This is the sample data i'm playing with: bucket -> 'testbucket' key1:{"name":"antonio","dob":1981,"country":"Spain"} key2:{"name":"rohman","dob":198