2

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.

Prakash Thapa
  • 1,285
  • 14
  • 27
  • might be duplicate of: http://stackoverflow.com/questions/13292609/how-do-you-sort-results-of-a-view-by-value-in-the-in-couchbase – Doody P Jun 25 '15 at 11:52

0 Answers0