I'm using Node.js with Cradle to call a CouchDB update handler. I need to pass an array in the querystring, but when I read the req.query object in CouchDB, only the first array value is available. So, for example using Cradle .update method:
db.update("myview/myupdate", id, {title:'sometitle',tags:['one','two']}, function }...
But when I check the QS value passed to CouchDB it's:
?title=sometitle&tags=one&tags=two
Then in the CouchDB update function, req.query.tags only gives me "two". I noticed that Cradle uses require("querystring") to do the "querystring.stringify", so I also tried visionmedia's require("qs") but then "qs.stringify" gives me:
?title=sometitle&tags[]=one&tags[]=two
It would seem that CouchDB wants the tags array passed as:
?title=sometitle&tags=["one","two"]
How can I build a querystring that looks like that?