I am using Couchbase 3.0 and I have a use case where I want to
perform sorting, but as I came through couchbase does not provide Sorting
on Values but it provides Sorting on Keys, But as I use
descending(true) it is returning me empty list. And on the other hand If
I just simply use it without descending then it is giving me all the
docs related.
My Map function is :
function (doc, meta) {
emit([meta.id,doc.latest.sortData],null);
}
}
Now my use case is that I want to perform a match query on meta.id
and then for all the matched cases sort the data and then find out the
top values.
The code that i am using to so is :
ViewQuery.from(DesignDocName, viewName).startKey(JsonArray.from(write(List("something","")))).descending(true).limit(5).stale(Stale.FALSE))
If I remove the descending parameter then I get the related rows but
they are not sorted. So could you please provide me a way in which this
can be done.
Any Help is appreciated
Thanks!