0
votes

I have set of Document in Data Bucket like

{
   "article_id": "107668",
   "domain": "thethao.baobelung.ma",
   "category_alias": "thethao-menu1",
   "ip": "115.77.224.119",
   "process_time": "635416228108751043",
   "created_at": "2014072210"
}

My View:

Map

function (doc, meta) {
  if(doc.article_id &&doc.category_alias && doc.domain){
    emit([doc.article_id,doc.category_alias,doc.domain],1);
  }
}

Reduce, I use built-in function _sum It's OK to execute results.

[_view/by_hour?group=true&connection_timeout=60000&limit=10&skip=0][1]

Results with group = true

{"rows":[
{"key":["100041","batdongsan-noi-that-nha-viet","m.batdongsan.baobelung.vn"],"value":1},
{"key":["100046","thethao-premier-league","thethao.baobelung.vn"],"value":1},
{"key":["100082","ban-doc-phap-luat","baobelung.vn"],"value":4},
{"key":["100116","van-hoa","m.baobelung.vn"],"value":1},
{"key":["100173","batdongsan-noi-that-nha-viet","m.batdongsan.baobelung.vn"],"value":2},
{"key":["100181","van-hoa","m.baobelung.vn"],"value":1},
{"key":["100195","van-hoa","m.baobelung.vn"],"value":1},
{"key":["100195","van-hoa","baobelung.vn"],"value":1},
{"key":["100272","batdongsan-noi-that-nha-viet","m.batdongsan.baobelung.vn"],"value":1},
{"key":["100274","batdongsan-noi-that-nha-viet","m.batdongsan.baobelung.vn"],"value":1}
]
}

But when I use C# to get view with option Group = True, then error:

var view = clientDetail.GetView("trackingdetail", "by_hour").Group(true);

Error converting value 1 to type 'Couchbase.IViewRow'. Path '', line 1, position 1.

Show me the way to get results to a List of Items?

1
I'm not familiar with couchbase.. but are you sure that Groups first parameter is a boolean and not an IViewRow? - Sayse
Yeb, It's equipment with query string "group=true" above (call via HTTP API) - Sonrobby

1 Answers

0
votes

Try to update your .net client libraries (SDK) to latest version first. And don't forget about latest Json encoder too... Updating to latest version solve mostly same problem for me...