couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jamie Talbot <ja...@jamietalbot.com>
Subject Re: array from query string
Date Tue, 27 Dec 2011 16:50:44 GMT
Untested, but off the top of my head, do you need to make tags an
array in the query string?

'PUT' /user1/_design/main/_update/docTags/somedoc?title=check&tags[]=four&tags[]=new&tags[]=okay%21

(note the square brackets)

Cheers,

Jamie.

On Tue, Dec 27, 2011 at 07:21, MK <mk@cognitivedissonance.ca> wrote:
> It seems to me that couch does not make arrays from multiple query
> pairs, eg, from the log:
>
> 'PUT' /user1/_design/main/_update/docTags/somedoc?
> title=check&tags=four&tags=new&tags=okay%21
>
> update/docTags contains:
>
> for (i in req.query.tags) doc.[req.query.tags[i]] = req.query.title
>
> But I get an error for the above request, "doc[req.query.tags[i]] is
> undefined", implying there is no array there; I haven't looked into
> this any further -- can anyone say definitively, "No, couch will not
> create arrays from query or post data in this sense," and if so, what
> rules does it follow?
>
> MK
>
> --
> "Enthusiasm is not the enemy of the intellect." (said of Irving Howe)
> "The angel of history[...]is turned toward the past." (Walter Benjamin)
>



-- 
---
http://jamietalbot.com

Mime
View raw message