Re: is there a way to pass a request parameter to a view ?

2009-09-24 Thread Jan Lehnardt
On 24 Sep 2009, at 02:31, go canal wrote: no problem. the link is still very useful. I found 'HTTP_Bulk_Document_API' but empty page now http://wiki.apache.org/couchdb/%5BHTTP_Bulk_Document_API Where di you find this (broken) link? The correct link is

Re: is there a way to pass a request parameter to a view ?

2009-09-24 Thread Matt Goodall
2009/9/24 Jan Lehnardt j...@apache.org: On 24 Sep 2009, at 02:31, go canal wrote: no problem. the link is still very useful. I found 'HTTP_Bulk_Document_API' but empty page now http://wiki.apache.org/couchdb/%5BHTTP_Bulk_Document_API Where di you find this (broken) link? The correct link

Re: is there a way to pass a request parameter to a view ?

2009-09-24 Thread Jan Lehnardt
On 24 Sep 2009, at 12:40, Matt Goodall wrote: 2009/9/24 Jan Lehnardt j...@apache.org: On 24 Sep 2009, at 02:31, go canal wrote: no problem. the link is still very useful. I found 'HTTP_Bulk_Document_API' but empty page now http://wiki.apache.org/couchdb/%5BHTTP_Bulk_Document_API Where

views don't work

2009-09-24 Thread Oliver Oli
I'm running couchdb 0.9.1. Everything worked fine until I tried my first view: test.js: function(doc) { emit(null, doc); } {error:error,reason:{function_clause,\n [{couch_view_group,'-design_doc_to_view_group/1-fun-0-',\n [{\test\,\function(doc) {\\n emit(null, doc);\\n}\},\n

Re: views don't work

2009-09-24 Thread Thomas Williams
Hi Oliver,You need to compose a view of a couple of sub elements. map and reduce. So assuming that you were just attempting this as a temporary query (rather than a stored one) you'd need to POST the following: { map: function(doc) { emit(null, doc); }} The differences between the map, and the

lucene error

2009-09-24 Thread Michael McCaffrey
Thought I'd throw this out here while I dig into the code... Any ideas why this is happening? I believe it is happening when the indices are being built for lucene. For instance, if I change a fulltext function, it happens when I save the document. 2009-09-24 10:47:37,744

Re: lucene error

2009-09-24 Thread Robert Newson
The first thing I'd suspect is a Javascript syntax or runtime error in your function (but, hey, I would say that, right?). This stack trace is at the point where user-entered data hits the runway, as it were, so it's not so unreasonable. Perhaps you could paste your fulltext function? B. On

RE: lucene error

2009-09-24 Thread Michael McCaffrey
Yep, I stepped down into the source to see where it executes the function... Here's the fulltext function. I'm referencing these fields in _views functions without a problem. fulltext: { by_description: { defaults: { store: yes }, index: function(doc)

Re: lucene error

2009-09-24 Thread Paul Davis
This is interesting, and I found it quite by accident. I just opened a js shell to check the f...@value syntax thinking that the @value wouldn't be a valid property name. $ js js f = {} [object Object] js f...@value = 2; 2 Which looks ok, but the first shell I actually tried did this: $ js

CouchDB _show and 404?

2009-09-24 Thread Zachary Zolton
Guys, Does CouchDB provide any hooks for me to execute some custom logic when a _show request points to non-existent docid? Otherwise, I'm guessing it'd be best just to hack around this in my nginx proxy... Cheers, Zach

Multiple IDs for one document

2009-09-24 Thread Adam Wolff
Hi list,We have a little data modeling problem and I'm wondering there's a pat solution for it. We have documents that look like this: { ids : [a, b], meta:{...} } In our system, a process can come along and need to add an id to the ids list. The ids must be globally unique. The only

Re: Multiple IDs for one document

2009-09-24 Thread Adam Wolff
We just thought of a funny alternative --- write every entity into one document. Not necessarily practical in every case, but it should work for us. A On Thu, Sep 24, 2009 at 1:07 PM, Benoit Chesneau bchesn...@gmail.comwrote: On Thu, Sep 24, 2009 at 9:45 PM, Adam Wolff awo...@gmail.com wrote:

Re: Multiple IDs for one document

2009-09-24 Thread Chris Anderson
On Thu, Sep 24, 2009 at 1:31 PM, Adam Wolff awo...@gmail.com wrote: We just thought of a funny alternative --- write every entity into one document. Not necessarily practical in every case, but it should work for us. A That's the right way to do it. On Thu, Sep 24, 2009 at 1:07 PM, Benoit

Redirect from _list function?

2009-09-24 Thread Zachary Zolton
Hello, Should I be able to do a redirect from a _list function? I ask because I've tried defining the following _list function: function(head, req) { return { 'code': 301, 'headers': { 'Location': 'http://www.google.com/' } }; } And, here's what happens when I try to hit it: $

Re: CouchDB _show and 404?

2009-09-24 Thread Zachary Zolton
My apologies! I just re-read the wiki and saw my answer: function(doc, req) { if(doc) { // regular doc display logic } else { // document not found if(req.docId) { // HANDLE MISSING DOC HERE!! } else { // handle unspecified doc id } } } RTFM-FTW! :^P On Thu,

Re: ruby script to auto update your views

2009-09-24 Thread Matt Aimonetti
gracias paco! - matt On Wed, Sep 23, 2009 at 4:29 PM, Francisco Viramontes p...@freshout.uswrote: http://gist.github.com/192378 Modified version of the script in http://wiki.apache.org/couchdb/Regenerating_views_on_update?action=showredirect=RegeneratingViewsOnUpdate PAco

Re: CouchDB _show and 404?

2009-09-24 Thread Chris Anderson
heh I guess it's already done :) On Thu, Sep 24, 2009 at 3:38 PM, Zachary Zolton zachary.zol...@gmail.com wrote: My apologies! I just re-read the wiki and saw my answer: function(doc, req) {  if(doc) {    // regular doc display logic  } else { // document not found    if(req.docId) {      

Re: CouchDB _show and 404?

2009-09-24 Thread Aaron Quint
Interesting. Can you actually return an HTTP 404 response code though? --AQ Aaron Quint http://www.quirkey.com On Thu, Sep 24, 2009 at 6:51 PM, Chris Anderson jch...@apache.org wrote: heh I guess it's already done :) On Thu, Sep 24, 2009 at 3:38 PM, Zachary Zolton zachary.zol...@gmail.com

Re: bind multiple IPs

2009-09-24 Thread go canal
I see, but I actually wanted to have something in between, not one IP, not all IPs. it is fine, it is a 'high want' on my list.  rgds, canal From: Paul Joseph Davis paul.joseph.da...@gmail.com To: user@couchdb.apache.org user@couchdb.apache.org Sent:

Re: is there a way to pass a request parameter to a view ?

2009-09-24 Thread go canal
thanks ! Can I use this bulk update to change a field without uploading the full doc: {   docs: [     {_id: 1, _rev: 1-2089673485, integer: 2},     {_id: 2, _rev: 1-2063452834, integer: 3, string: 3}   ] }  So for doc _id 1, I only change 'integer'; will the rest be kept intact, or CouchDB

Re: bind multiple IPs

2009-09-24 Thread Paul Davis
I'm actually unfamiliar with even the POSIX API for binding ranges of IP's. If you know the mechanics for such things that'd give me a good starting place for seeing what Erlang has to offer. Paul On Thu, Sep 24, 2009 at 9:15 PM, go canal goca...@yahoo.com wrote: I see, but I actually wanted to

Re: is there a way to pass a request parameter to a view ?

2009-09-24 Thread Jesse Hallett
Sorry, you have to upload the whole doc. You do not have to send attachments again though. On Sep 24, 2009 6:14 PM, go canal goca...@yahoo.com wrote: thanks ! Can I use this bulk update to change a field without uploading the full doc: { docs: [ {_id: 1, _rev: 1-2089673485, integer: 2},

Re: Redirect from _list function?

2009-09-24 Thread Zachary Zolton
So, can anyone give a reason why this _list function shouldn't work? On Thu, Sep 24, 2009 at 5:34 PM, Zachary Zolton zachary.zol...@gmail.com wrote: Hello, Should I be able to do a redirect from a _list function? I ask because I've tried defining the following _list function:

Re: Redirect from _list function?

2009-09-24 Thread Paul Davis
Bit tired here but two thoughts. Theoretically returning a 304 should work fine I think. The question is what mutation happens when processing the _list. I'd suggest taking a glance at render.js to see if maybe you're getting caught by a corner case. Paul On Thu, Sep 24, 2009 at 11:50 PM,

Re: Redirect from _list function?

2009-09-24 Thread Zachary Zolton
Theoretically returning a 304 should work fine I think. I thought 304 was for etag/caching validation...? I'd suggest taking a glance at render.js to see if maybe you're getting caught by a corner case. Hm... I'm gonna have to learn more about list functions work to understand what's going

Re: is there a way to pass a request parameter to a view ?

2009-09-24 Thread go canal
thanks for confirming, I think it is acceptable, though not ideal. Just wondering, since we can modify individual field with Futon, why don't we expose the API ? rgds, canal From: Jesse Hallett halle...@gmail.com To: user@couchdb.apache.org Sent: Friday,