Can parameters be passed to views? I know you can use them in updaters.
I hoped this would work, but it did not:
function(doc, req) {
var myparam = req.query.myparam;
...
URL: .../view_name?myparam="foo"
I need to pass two parameters to a for loop which is pulling data from
an array/list.
I have data stored in the array "words".
function(doc) {
for (i=0; i < doc.words.length;i++) {
emit(i, doc.words[i]);
}
}
This outputs ALL items in the array. I want to pass in A and B as
params to the for loop.
Can this be done, or is there another way to achieve it?
Thanks,
Marcus