I am newbie to write couchdb map and reduce queries. One of my requirements is based on some keys we have to emit the data. i wrote Successfully for that as mentioned below.
function(doc) {
emit([doc.type , doc.category, doc.user], doc);
}
If we give three key values like
http://localhost:5984/test/_design/myDesign/_view/myView?key=["Science","A","John"]
then that data will be emitted. But my doubt is how can i get the data if we give one key or two keys for that view. That means for the above view if the user mentioned one key like doc.user then the user data will be emitted based on the three keys. And one more doubt is, Can we give two values for one key? ? Suppose the user wants to get the data either user name is JOHN or Joe by using the same view. Please provide guidance to achieve.
Thanks.