Follow Example at https://github.com/couchbaselabs/docs-ng/blob/master/content/couchbase-sdk-net-1.3/couchbase-and-asp-net-mvc.markdown :
I have a View: beer/by_country of beer-sample bucket:
Map:
function (doc, meta) {
if (doc.country && doc.state && doc.city && doc.code) {
emit([doc.country, doc.state, doc.city, doc.code], null);
}
}
Reduce use built-in function: _count
In .NET, I get View by
var view = client.GetView("beer", "by_country").Group(true).GroupAt(3);
But I get error:
- Error converting value 1 to type ‘Couchbase.IViewRow’. Path ‘’, line 1, position 1.
Show me where i’m wrong?
{"rows":[
{"key":["Argentina","Buenos Aires","San Martin"],"value":1},
{"key":["Australia","NSW","Picton"],"value":1},
{"key":["Australia","Victoria","Little River"],"value":1},
{"key":["Australia","WA","Fremantle"],"value":1},
{"key":["Belgium","Brabant","Steenhuffel"],"value":1},
{"key":["Belgium","Hainaut","Brunehaut"],"value":1},
{"key":["Belgium","West-Vlaanderen","Brugge"],"value":1},
{"key":["Belgium","West-Vlaanderen","Esen"],"value":1},
{"key":["Canada","Alberta","Calgary"],"value":2},
{"key":["Canada","British Columbia","Burnaby"],"value":1}
]
}