Hi,
I have created a development view in Couchbase bucket with data of the following format:
{
“productId”: “1-124DH9”,
“productCode”: “PCODE”,
“type”: “Example.Product”
}
The view created is -
function (doc, meta) {
if (doc.type && doc.type == Product’) {
emit([doc.productId], null);
}
}
After storing data into the bucket and running this view I get all the data related to this productCrmId.
View result –
{“total_rows”:200,“rows”:[
{“id”:" Product#1-124DH9",“key”:[“1-124DH9”],“value”:null},
{“id”:" Product#1-12VEXP",“key”:[“1-12VEXP”],“value”:null},
…
…
]
Now my problem is that I want to get this view result in my code filtered by list of keys.
The GetView(designDoc, view, true).Keys<string[]>(new string[] {}) method accepts multiple keys for the same
compound index.
But I have just one key per index, and I cannot find any method using which I can
pass multiple key values and get a list of objects back from the view.
Basically, I want 2 objects returned if I search a view using the following 2 keys - “1-124DH9” and “1-12VEXP”.
Any pointers or suggestions would be great!
TIA