I Have a map function
function (doc, meta) {
emit([doc.Marks,doc.Acc_no],doc.Type);
}
In this when I send startkey and endkey as follows
startkey = [13]
endkey = [86]
I get all the documents having marks between 13 and 86 as expected irrespective of Acc_No.
Now what I am trying is a query like this
startkey =[,1]
endkey = [,5]
That is I want all documents having Acc_no between 1 and 5 irrespective of their Marks but I am getting error in this type of query. How can I accomplish my second type of query without making a new view?
No, you can't do that. If you create a key, as an array here, you should use the "first N", you can skip the last objects in the array, but you must specify them from start to some point. So you can skip only from the right, not from the left.
To achieve your goal here you have 2 choices:
For more information, refer to the documentations.
http://docs.couchbase.com/admin/admin/Views/views-querying.html