Testing suite and upgrades

2010-05-20 Thread Patrick Barnes
I recently upgraded my couchdb server, and I can't run the test suite; there are existing databases and users defined. Is there a better way to test that the database server is working properly other than having to delete all the administrators and manually restore them later? -Patrick

Re: Multiple map reduce stages

2010-05-20 Thread Kropp, Henning
Am 20.05.2010 10:48, schrieb Kropp, Henning: Am 18.05.2010 20:16, schrieb J Chris Anderson: On May 18, 2010, at 2:52 AM, Kropp, Henning wrote: Hi, as far as I know working with map reduce commonly involves multiple map and reduce stages. A view in couchdb solely consists of

Re: Multiple map reduce stages

2010-05-20 Thread Simon Metson
Hi, I came up with the following solution. Grouping by value (uri) and time using the group_level=1 and the start and end key like follow: /_temp_view? group=truegroup_level=1startkey=[1270826004.0]endkey=[{}, 1270826011.0] and simply counting function(doc) { emit([doc.URI,doc.Time], 1

Reduce function results

2010-05-20 Thread Tom Sante
Hi, I have a reduce function like this: // reduce function function (keys, values, rereduce) { var res={}; if(!rereduce){ /* reduce */ for(var val in values){ for(var v_n in values[val]){ var v = new Number(values[val][v_n]);

Re: Multiple map reduce stages

2010-05-20 Thread Kropp, Henning
Am 20.05.2010 12:25, schrieb Simon Metson: Hi, I came up with the following solution. Grouping by value (uri) and time using the group_level=1 and the start and end key like follow: /_temp_view?group=truegroup_level=1startkey=[1270826004.0]endkey=[{},1270826011.0] and simply counting

Re: Multiple map reduce stages

2010-05-20 Thread Robert Newson
If it helps, you can only group from the left side of the array. for ['a', 'b', 'c'], group_level=1 is ['a'], group_level=2 is ['a', 'b'] and group_level=3 is ['a', 'b', 'c']. B. On Thu, May 20, 2010 at 1:25 PM, Kropp, Henning hkr...@microlution.de wrote: Am 20.05.2010 12:25, schrieb Simon

Re: Testing suite and upgrades

2010-05-20 Thread J Chris Anderson
On May 20, 2010, at 1:01 AM, Patrick Barnes wrote: I recently upgraded my couchdb server, and I can't run the test suite; there are existing databases and users defined. Is there a better way to test that the database server is working properly other than having to delete all the

Re: Reduce function results

2010-05-20 Thread David Goodlad
On Thu, May 20, 2010 at 9:38 PM, Tom Sante tom.sa...@gmail.com wrote: Hi, I have a reduce function like this: [snip] So for some reason if there is only 1 element to be reduced, on the line of res[v_n]={'mi':v,'ma':v,'c':1,'t':v}; v becomes v={} and not the actual number. Any ideas why? I

Re: Reduce function results

2010-05-20 Thread Tom Sante
On 20/05/10 23:52, David Goodlad wrote: On Thu, May 20, 2010 at 9:38 PM, Tom Santetom.sa...@gmail.com wrote: Hi, I have a reduce function like this: [snip] So for some reason if there is only 1 element to be reduced, on the line of res[v_n]={'mi':v,'ma':v,'c':1,'t':v}; v becomes v={} and not

Re: Reduce function results

2010-05-20 Thread Zachary Zolton
Reduce functions can be tricky. My best advice: try log()'ing all your input and intermediary results; the answer usually jumps out to ya. On Thursday, May 20, 2010, Tom Sante tom.sa...@gmail.com wrote: On 20/05/10 23:52, David Goodlad wrote: On Thu, May 20, 2010 at 9:38 PM, Tom