I have SQL query like this:
select count(id) as ct, city from table group by city order by ct desc
How can I perform this query in Couchbase? I have map function like This:
function (doc, meta) {
if(doc.city!==null) {
emit(doc.city,1)
}
}
and reduce:
_count
my query url is like this:
_view/q7?group_level=1&descending=true
but it it sort only for key not for value.